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