fix type and make strict equal

This commit is contained in:
catchonme
2018-06-23 18:46:47 +08:00
parent a387a4d6f7
commit 770922a9d2
3 changed files with 40 additions and 40 deletions

View File

@ -6694,7 +6694,7 @@ const matchesWith = (obj, source, fn) =>
key => key =>
obj.hasOwnProperty(key) && fn obj.hasOwnProperty(key) && fn
? fn(obj[key], source[key], key, obj, source) ? fn(obj[key], source[key], key, obj, source)
: obj[key] == source[key] : obj[key] === source[key]
); );
``` ```
@ -7114,7 +7114,7 @@ truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex
### unflattenObject ![advanced](/advanced.svg) ### unflattenObject ![advanced](/advanced.svg)
Unlatten an object with the paths for keys. Unflatten an object with the paths for keys.
Use `Object.keys(obj)` combined with `Array.reduce()` to convert flattened path node to a leaf node. Use `Object.keys(obj)` combined with `Array.reduce()` to convert flattened path node to a leaf node.
If the value of a key contains a dot delimiter (`.`), use `Array.split('.')`, string transformations and `JSON.parse()` to create an object, then `Object.assign()` to create the leaf node. If the value of a key contains a dot delimiter (`.`), use `Array.split('.')`, string transformations and `JSON.parse()` to create an object, then `Object.assign()` to create the leaf node.

View File

@ -11,7 +11,7 @@ const matchesWith = (obj, source, fn) =>
key => key =>
obj.hasOwnProperty(key) && fn obj.hasOwnProperty(key) && fn
? fn(obj[key], source[key], key, obj, source) ? fn(obj[key], source[key], key, obj, source)
: obj[key] == source[key] : obj[key] === source[key]
); );
``` ```

View File

@ -1,6 +1,6 @@
### unflattenObject ### unflattenObject
Unlatten an object with the paths for keys. Unflatten an object with the paths for keys.
Use `Object.keys(obj)` combined with `Array.reduce()` to convert flattened path node to a leaf node. Use `Object.keys(obj)` combined with `Array.reduce()` to convert flattened path node to a leaf node.
If the value of a key contains a dot delimiter (`.`), use `Array.split('.')`, string transformations and `JSON.parse()` to create an object, then `Object.assign()` to create the leaf node. If the value of a key contains a dot delimiter (`.`), use `Array.split('.')`, string transformations and `JSON.parse()` to create an object, then `Object.assign()` to create the leaf node.