Comparing version 2.2.0 to 2.2.1
23
index.js
@@ -48,2 +48,10 @@ 'use strict'; | ||
const getProxyTarget = value => { | ||
if (value) { | ||
return value[proxyTarget] || value; | ||
} | ||
return value; | ||
}; | ||
const handler = { | ||
@@ -85,10 +93,4 @@ get(target, property, receiver) { | ||
set(target, property, value, receiver) { | ||
if (value) { | ||
const valueProxyTarget = value[proxyTarget]; | ||
value = getProxyTarget(value); | ||
if (valueProxyTarget !== undefined) { | ||
value = valueProxyTarget; | ||
} | ||
} | ||
const reflectTarget = target[proxyTarget] || target; | ||
@@ -146,2 +148,3 @@ const previous = reflectTarget[property]; | ||
const applyPath = path.initial(cache.getPath(target)); | ||
const isHandledMethod = SmartClone.isHandledMethod(thisProxyTarget, target.name); | ||
@@ -153,3 +156,5 @@ smartClone.start(thisProxyTarget, applyPath, argumentsList); | ||
smartClone.preferredThisArg(target, thisArg, thisProxyTarget), | ||
argumentsList | ||
isHandledMethod ? | ||
argumentsList.map(argument => getProxyTarget(argument)) : | ||
argumentsList | ||
); | ||
@@ -168,3 +173,3 @@ | ||
return (SmartClone.isHandledType(result) && SmartClone.isHandledMethod(thisProxyTarget, target.name)) ? | ||
return (SmartClone.isHandledType(result) && isHandledMethod) ? | ||
cache.getProxy(result, applyPath, handler) : | ||
@@ -171,0 +176,0 @@ result; |
{ | ||
"name": "on-change", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Watch an object or array for changes", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
28768
774