@valkyriestudios/utils 12.41.1 → 12.41.2
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/cjs/object/omit.js +3 -4
- package/cjs/object/scramble.js +3 -4
- package/esm/object/omit.js +3 -4
- package/esm/object/scramble.js +3 -4
- package/package.json +1 -1
package/cjs/object/omit.js
CHANGED
|
@@ -7,7 +7,7 @@ function wildcardProp(target, source, prop) {
|
|
|
7
7
|
for (let i = 0; i < target.length; i++) {
|
|
8
8
|
const t = target[i];
|
|
9
9
|
const s = source[i];
|
|
10
|
-
if (
|
|
10
|
+
if (Object.prototype.toString.call(t) === '[object Object]' || Array.isArray(t)) {
|
|
11
11
|
if (t === s)
|
|
12
12
|
target[i] = { ...t };
|
|
13
13
|
wildcardProp(target[i], s, prop);
|
|
@@ -22,7 +22,7 @@ function wildcardProp(target, source, prop) {
|
|
|
22
22
|
else {
|
|
23
23
|
const val = target[key];
|
|
24
24
|
const s_val = source?.[key];
|
|
25
|
-
if (
|
|
25
|
+
if (Object.prototype.toString.call(val) === '[object Object]' || Array.isArray(val)) {
|
|
26
26
|
if (val === s_val) {
|
|
27
27
|
target[key] = Array.isArray(val) ? [...val] : { ...val };
|
|
28
28
|
}
|
|
@@ -61,9 +61,8 @@ function standardProp(target, source, path) {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
if (target &&
|
|
64
|
+
if (target && path[last] in source)
|
|
65
65
|
delete target[path[last]];
|
|
66
|
-
}
|
|
67
66
|
}
|
|
68
67
|
function omit(obj, keys) {
|
|
69
68
|
if (Object.prototype.toString.call(obj) !== '[object Object]' ||
|
package/cjs/object/scramble.js
CHANGED
|
@@ -7,7 +7,7 @@ function wildcardProp(target, source, prop, repl) {
|
|
|
7
7
|
for (let i = 0; i < target.length; i++) {
|
|
8
8
|
const t = target[i];
|
|
9
9
|
const s = source[i];
|
|
10
|
-
if (
|
|
10
|
+
if (Object.prototype.toString.call(t) === '[object Object]') {
|
|
11
11
|
if (t === s)
|
|
12
12
|
target[i] = { ...t };
|
|
13
13
|
wildcardProp(target[i], s, prop, repl);
|
|
@@ -22,7 +22,7 @@ function wildcardProp(target, source, prop, repl) {
|
|
|
22
22
|
else {
|
|
23
23
|
const val = target[key];
|
|
24
24
|
const s_val = source?.[key];
|
|
25
|
-
if (
|
|
25
|
+
if (Object.prototype.toString.call(val) === '[object Object]' || Array.isArray(val)) {
|
|
26
26
|
if (val === s_val) {
|
|
27
27
|
target[key] = Array.isArray(val) ? [...val] : { ...val };
|
|
28
28
|
}
|
|
@@ -61,9 +61,8 @@ function standardProp(target, source, path, repl) {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
if (target &&
|
|
64
|
+
if (target && path[last] in source)
|
|
65
65
|
target[path[last]] = repl;
|
|
66
|
-
}
|
|
67
66
|
}
|
|
68
67
|
function scramble(obj, keys, options) {
|
|
69
68
|
if (Object.prototype.toString.call(obj) !== '[object Object]' ||
|
package/esm/object/omit.js
CHANGED
|
@@ -3,7 +3,7 @@ function wildcardProp(target, source, prop) {
|
|
|
3
3
|
for (let i = 0; i < target.length; i++) {
|
|
4
4
|
const t = target[i];
|
|
5
5
|
const s = source[i];
|
|
6
|
-
if (
|
|
6
|
+
if (Object.prototype.toString.call(t) === '[object Object]' || Array.isArray(t)) {
|
|
7
7
|
if (t === s)
|
|
8
8
|
target[i] = { ...t };
|
|
9
9
|
wildcardProp(target[i], s, prop);
|
|
@@ -18,7 +18,7 @@ function wildcardProp(target, source, prop) {
|
|
|
18
18
|
else {
|
|
19
19
|
const val = target[key];
|
|
20
20
|
const s_val = source?.[key];
|
|
21
|
-
if (
|
|
21
|
+
if (Object.prototype.toString.call(val) === '[object Object]' || Array.isArray(val)) {
|
|
22
22
|
if (val === s_val) {
|
|
23
23
|
target[key] = Array.isArray(val) ? [...val] : { ...val };
|
|
24
24
|
}
|
|
@@ -57,9 +57,8 @@ function standardProp(target, source, path) {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
if (target &&
|
|
60
|
+
if (target && path[last] in source)
|
|
61
61
|
delete target[path[last]];
|
|
62
|
-
}
|
|
63
62
|
}
|
|
64
63
|
function omit(obj, keys) {
|
|
65
64
|
if (Object.prototype.toString.call(obj) !== '[object Object]' ||
|
package/esm/object/scramble.js
CHANGED
|
@@ -3,7 +3,7 @@ function wildcardProp(target, source, prop, repl) {
|
|
|
3
3
|
for (let i = 0; i < target.length; i++) {
|
|
4
4
|
const t = target[i];
|
|
5
5
|
const s = source[i];
|
|
6
|
-
if (
|
|
6
|
+
if (Object.prototype.toString.call(t) === '[object Object]') {
|
|
7
7
|
if (t === s)
|
|
8
8
|
target[i] = { ...t };
|
|
9
9
|
wildcardProp(target[i], s, prop, repl);
|
|
@@ -18,7 +18,7 @@ function wildcardProp(target, source, prop, repl) {
|
|
|
18
18
|
else {
|
|
19
19
|
const val = target[key];
|
|
20
20
|
const s_val = source?.[key];
|
|
21
|
-
if (
|
|
21
|
+
if (Object.prototype.toString.call(val) === '[object Object]' || Array.isArray(val)) {
|
|
22
22
|
if (val === s_val) {
|
|
23
23
|
target[key] = Array.isArray(val) ? [...val] : { ...val };
|
|
24
24
|
}
|
|
@@ -57,9 +57,8 @@ function standardProp(target, source, path, repl) {
|
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
if (target &&
|
|
60
|
+
if (target && path[last] in source)
|
|
61
61
|
target[path[last]] = repl;
|
|
62
|
-
}
|
|
63
62
|
}
|
|
64
63
|
function scramble(obj, keys, options) {
|
|
65
64
|
if (Object.prototype.toString.call(obj) !== '[object Object]' ||
|