@mongez/reinforcements 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/object/get.js +4 -1
- package/esm/object/get.js +4 -1
- package/package.json +1 -1
package/cjs/object/get.js
CHANGED
|
@@ -8,7 +8,10 @@ function getValue(object, keyChain, defaultValue) {
|
|
|
8
8
|
if (acc === undefined || typeof acc !== "object") {
|
|
9
9
|
return defaultValue;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
if (acc === null) return acc;
|
|
12
|
+
return acc.hasOwnProperty && acc.hasOwnProperty(key)
|
|
13
|
+
? acc[key]
|
|
14
|
+
: defaultValue;
|
|
12
15
|
}, object);
|
|
13
16
|
}
|
|
14
17
|
/**
|
package/esm/object/get.js
CHANGED
|
@@ -6,7 +6,10 @@ function getValue(object, keyChain, defaultValue) {
|
|
|
6
6
|
if (acc === undefined || typeof acc !== "object") {
|
|
7
7
|
return defaultValue;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
if (acc === null) return acc;
|
|
10
|
+
return acc.hasOwnProperty && acc.hasOwnProperty(key)
|
|
11
|
+
? acc[key]
|
|
12
|
+
: defaultValue;
|
|
10
13
|
}, object);
|
|
11
14
|
}
|
|
12
15
|
/**
|
package/package.json
CHANGED