@vitus-labs/core 1.3.4-alpha.4 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -2
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -366,16 +366,17 @@ const UNSAFE_KEYS = new Set([
|
|
|
366
366
|
]);
|
|
367
367
|
const set = (obj, path, value) => {
|
|
368
368
|
const keys = parsePath(path);
|
|
369
|
-
if (keys.some((k) => UNSAFE_KEYS.has(k))) return obj;
|
|
370
369
|
let current = obj;
|
|
371
370
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
372
371
|
const key = keys[i];
|
|
372
|
+
if (UNSAFE_KEYS.has(key)) return obj;
|
|
373
373
|
const nextKey = keys[i + 1];
|
|
374
|
+
if (UNSAFE_KEYS.has(nextKey)) return obj;
|
|
374
375
|
if (current[key] == null) current[key] = /^\d+$/.test(nextKey) ? [] : {};
|
|
375
376
|
current = current[key];
|
|
376
377
|
}
|
|
377
378
|
const lastKey = keys[keys.length - 1];
|
|
378
|
-
if (lastKey != null) current[lastKey] = value;
|
|
379
|
+
if (lastKey != null && !UNSAFE_KEYS.has(lastKey)) current[lastKey] = value;
|
|
379
380
|
return obj;
|
|
380
381
|
};
|
|
381
382
|
const throttle = (fn, wait = 0, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Vit Bokisch <vit@bokisch.cz>",
|
|
6
6
|
"maintainers": [
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"@vitus-labs/tools-rolldown": "^1.6.0",
|
|
62
62
|
"@vitus-labs/tools-typescript": "^1.6.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "297985a88495c40ddebfdccdd3ab35f9e41bbe0c"
|
|
65
65
|
}
|