@valkyriestudios/utils 12.41.1 → 12.41.3

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.
@@ -10,7 +10,7 @@ function innerMerge(target, source, UNION) {
10
10
  if (s_val !== undefined && t_val !== s_val) {
11
11
  target[key] = Object.prototype.toString.call(t_val) === '[object Object]' &&
12
12
  Object.prototype.toString.call(s_val) === '[object Object]'
13
- ? innerMerge(t_val, s_val, UNION)
13
+ ? innerMerge({ ...t_val }, s_val, UNION)
14
14
  : s_val;
15
15
  }
16
16
  }
@@ -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 (typeof t === 'object' && t !== null && typeof s === 'object' && s !== null) {
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 (typeof val === 'object' && typeof s_val === 'object' && val !== null && s_val !== null) {
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 && typeof target === 'object' && path[last] in source) {
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]' ||
@@ -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 (typeof t === 'object' && t !== null && typeof s === 'object' && s !== null) {
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 (typeof val === 'object' && typeof s_val === 'object' && val !== null && s_val !== null) {
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 && typeof target === 'object' && path[last] in source) {
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]' ||
@@ -6,7 +6,7 @@ function innerMerge(target, source, UNION) {
6
6
  if (s_val !== undefined && t_val !== s_val) {
7
7
  target[key] = Object.prototype.toString.call(t_val) === '[object Object]' &&
8
8
  Object.prototype.toString.call(s_val) === '[object Object]'
9
- ? innerMerge(t_val, s_val, UNION)
9
+ ? innerMerge({ ...t_val }, s_val, UNION)
10
10
  : s_val;
11
11
  }
12
12
  }
@@ -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 (typeof t === 'object' && t !== null && typeof s === 'object' && s !== null) {
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 (typeof val === 'object' && typeof s_val === 'object' && val !== null && s_val !== null) {
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 && typeof target === 'object' && path[last] in source) {
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]' ||
@@ -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 (typeof t === 'object' && t !== null && typeof s === 'object' && s !== null) {
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 (typeof val === 'object' && typeof s_val === 'object' && val !== null && s_val !== null) {
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 && typeof target === 'object' && path[last] in source) {
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]' ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valkyriestudios/utils",
3
- "version": "12.41.1",
3
+ "version": "12.41.3",
4
4
  "description": "A collection of single-function utilities for common tasks",
5
5
  "author": {
6
6
  "name": "Peter Vermeulen",