@kizmann/pico-js 0.3.28 → 0.3.30

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.28",
3
+ "version": "0.3.30",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": "Eduard Kizmann <kizmann@protonmail.ch>",
@@ -27,7 +27,13 @@ export class Obj
27
27
  keys = keys.join('.');
28
28
  }
29
29
 
30
- if ( obj[keys] !== undefined && obj[keys] !== null ) {
30
+ let undef = true;
31
+
32
+ if ( typeof obj === 'object' ) {
33
+ undef = obj[keys] === null || obj[keys] === undefined
34
+ }
35
+
36
+ if ( ! undef ) {
31
37
  return obj[keys];
32
38
  }
33
39
 
@@ -64,7 +70,13 @@ export class Obj
64
70
  keys = keys.toString();
65
71
  }
66
72
 
67
- if ( obj[keys] !== undefined ) {
73
+ let undef = true;
74
+
75
+ if ( typeof obj === 'object' ) {
76
+ undef = obj[keys] === null || obj[keys] === undefined
77
+ }
78
+
79
+ if ( ! undef ) {
68
80
  obj[keys] = val; return obj;
69
81
  }
70
82