forked from MapComplete/MapComplete
Merge branch 'develop' into feature/vite
This commit is contained in:
commit
562dfbc5ff
6 changed files with 140 additions and 5 deletions
5
Utils.ts
5
Utils.ts
|
@ -466,6 +466,9 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
/**
|
||||
* Copies all key-value pairs of the source into the target. This will change the target
|
||||
* If the key starts with a '+', the values of the list will be appended to the target instead of overwritten
|
||||
* If the key starts with `=`, the property will be overwritten.
|
||||
*
|
||||
* 'Source' will not be modified, but 'Target' will be
|
||||
*
|
||||
* const obj = {someValue: 42};
|
||||
* const override = {someValue: null};
|
||||
|
@ -501,7 +504,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
* result.list2.length // => 1
|
||||
* result.list2[0] // => "should-be-untouched"
|
||||
*/
|
||||
static Merge<T, S>(source: S, target: T): T & S {
|
||||
static Merge<T, S>(source: Readonly<S>, target: T): T & S {
|
||||
if (target === null) {
|
||||
return <T & S>source
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue