Comparing version 1.4.0 to 1.5.0
10
index.js
@@ -47,5 +47,4 @@ 'use strict'; | ||
const proxyTarget = Symbol('ProxyTarget'); | ||
const onChange = (object, onChange, options = {}) => { | ||
const proxyTarget = Symbol('ProxyTarget'); | ||
let inApply = false; | ||
@@ -65,3 +64,3 @@ let changed = false; | ||
if (inApply && previous !== undefined && value !== undefined && property !== 'length') { | ||
if (inApply && applyPrevious && previous !== undefined && value !== undefined && property !== 'length') { | ||
let item = applyPrevious; | ||
@@ -197,3 +196,3 @@ | ||
if (Array.isArray(thisArg)) { | ||
if (Array.isArray(thisArg) || Object.prototype.toString.call(thisArg) === '[object Object]') { | ||
applyPrevious = shallowClone(thisArg[proxyTarget]); | ||
@@ -203,3 +202,4 @@ } | ||
applyPath = pathCache.get(target); | ||
applyPath = applyPath.slice(0, applyPath.lastIndexOf(PATH_SEPARATOR)); | ||
applyPath = applyPath.slice(0, Math.max(applyPath.lastIndexOf(PATH_SEPARATOR), 0)); | ||
const result = Reflect.apply(target, thisArg, argumentsList); | ||
@@ -206,0 +206,0 @@ |
{ | ||
"name": "on-change", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"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
12583