Improve documentation and types

This commit is contained in:
Pieter Vander Vennet 2023-01-20 11:59:41 +01:00
parent 6555bb4d90
commit 2ed5884d9d

View file

@ -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
}