Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@plcmp/pl-data-observer

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@plcmp/pl-data-observer - npm Package Compare versions

Comparing version
0.1.6
to
0.1.7
+1
-1
package.json
{
"name": "@plcmp/pl-data-observer",
"version": "0.1.6",
"version": "0.1.7",
"description": "Data mutation observer component",

@@ -5,0 +5,0 @@ "main": "pl-data-observer.js",

@@ -106,7 +106,5 @@ import { PlElement, css } from "polylib";

reset(obj) {
setTimeout(() => {
this.isChanged = false;
this._isChangedArray = false;
this._clearMutation(obj);
}, 0);
this.isChanged = false;
this._isChangedArray = false;
this._clearMutation(obj);
}

@@ -165,19 +163,16 @@

snapshot(obj) {
// wait for nested components initialize
setTimeout(() => {
this.isChanged = false;
obj = obj || this.data;
if (Array.isArray(obj)) {
obj.forEach((i) => {
if (i instanceof Object) this.snapshot(i);
});
} else {
obj._old = obj._old || {};
Object.keys(obj).forEach((k) => {
if (k === '_old') return;
if (obj[k] instanceof Object && !(obj[k] instanceof Date)) this.snapshot(obj[k]);
else obj._old[k] = obj[k];
});
}
}, 0);
this.isChanged = false;
obj = obj || this.data;
if (Array.isArray(obj)) {
obj.forEach((i) => {
if (i instanceof Object) this.snapshot(i);
});
} else {
obj._old = obj._old || {};
Object.keys(obj).forEach((k) => {
if (k === '_old') return;
if (obj[k] instanceof Object && !(obj[k] instanceof Date)) this.snapshot(obj[k]);
else obj._old[k] = obj[k];
});
}
}

@@ -184,0 +179,0 @@ }