You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2024. It is now read-only.
[kinkeyofInpasMapping[k]extendsstring/* if we have a string mapping for this key then use it */
7
+
? Mapping[k]
8
+
: Mapping[k]extendsnull/* if the mapping is to `null` then drop the key */
9
+
? never
10
+
: k/* otherwise keep the key as-is */]: Inp[k];
11
+
};
12
+
13
+
/**
14
+
* Converts or omits an object's keys according to a mapping.
15
+
*
16
+
* @param inp An object whose keys will be remapped
17
+
* @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object.
18
+
* @returns A new object with keys remapped or omitted according to the mappings
0 commit comments