Improve documentation and types
This commit is contained in:
parent
6555bb4d90
commit
2ed5884d9d
1 changed files with 4 additions and 1 deletions
5
Utils.ts
5
Utils.ts
|
@ -459,6 +459,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};
|
||||
|
@ -494,7 +497,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…
Reference in a new issue