proxy-state-tree
Advanced tools
Comparing version 1.0.0-1531949621045 to 1.0.0-1531951520682
import proxify, { IS_PROXY, STATUS } from './proxify'; | ||
const isPlainObject = require('is-plain-object'); | ||
class ProxyStateTree { | ||
constructor(state, options = { devmode: true }) { | ||
if (!isPlainObject(state)) { | ||
throw new Error('You have to pass a plain object to the Proxy State Tree'); | ||
} | ||
this.state = state; | ||
@@ -5,0 +9,0 @@ this.options = options; |
@@ -60,2 +60,5 @@ const isPlainObject = require('is-plain-object'); | ||
} | ||
if (target[prop] === undefined) { | ||
return undefined; | ||
} | ||
return (target[prop] = proxify(tree, target[prop], nestedPath)); | ||
@@ -96,2 +99,5 @@ }, | ||
} | ||
if (targetValue === undefined) { | ||
return undefined; | ||
} | ||
return (target[prop] = proxify(tree, targetValue, nestedPath)); | ||
@@ -98,0 +104,0 @@ }, |
@@ -5,4 +5,8 @@ "use strict"; | ||
exports.IS_PROXY = proxify_1.IS_PROXY; | ||
const isPlainObject = require('is-plain-object'); | ||
class ProxyStateTree { | ||
constructor(state, options = { devmode: true }) { | ||
if (!isPlainObject(state)) { | ||
throw new Error('You have to pass a plain object to the Proxy State Tree'); | ||
} | ||
this.state = state; | ||
@@ -9,0 +13,0 @@ this.options = options; |
@@ -62,2 +62,5 @@ "use strict"; | ||
} | ||
if (target[prop] === undefined) { | ||
return undefined; | ||
} | ||
return (target[prop] = proxify(tree, target[prop], nestedPath)); | ||
@@ -98,2 +101,5 @@ }, | ||
} | ||
if (targetValue === undefined) { | ||
return undefined; | ||
} | ||
return (target[prop] = proxify(tree, targetValue, nestedPath)); | ||
@@ -100,0 +106,0 @@ }, |
{ | ||
"name": "proxy-state-tree", | ||
"version": "1.0.0-1531949621045", | ||
"version": "1.0.0-1531951520682", | ||
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
200512
2022