@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kizmann/pico-js",
3
- "version": "0.3.26",
3
+ "version": "0.3.29",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -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;