@kizmann/pico-js 0.3.26 → 0.3.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/pico-js.js +1 -1
- package/dist/pico-js.js.map +1 -1
- package/package.json +1 -1
- package/src/utility/object.js +14 -0
package/package.json
CHANGED
package/src/utility/object.js
CHANGED
@@ -27,6 +27,13 @@ export class Obj
|
|
27
27
|
keys = keys.join('.');
|
28
28
|
}
|
29
29
|
|
30
|
+
let undef = typeof obj === 'object' && (obj[keys] === null ||
|
31
|
+
obj[keys] === undefined);
|
32
|
+
|
33
|
+
if ( ! undef ) {
|
34
|
+
return obj[keys];
|
35
|
+
}
|
36
|
+
|
30
37
|
if ( ! Any.isString(keys) ) {
|
31
38
|
keys = keys.toString();
|
32
39
|
}
|
@@ -60,6 +67,13 @@ export class Obj
|
|
60
67
|
keys = keys.toString();
|
61
68
|
}
|
62
69
|
|
70
|
+
let undef = typeof obj === 'object' && (obj[keys] !== null ||
|
71
|
+
obj[keys] !== undefined);
|
72
|
+
|
73
|
+
if ( ! undef ) {
|
74
|
+
obj[keys] = val; return obj;
|
75
|
+
}
|
76
|
+
|
63
77
|
keys = keys.split('.');
|
64
78
|
|
65
79
|
let index = 0, length = keys.length, nested = obj;
|