@jsopen/objects 1.6.1 → 1.6.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.
- package/CHANGELOG.md +3 -3
- package/cjs/clone.js +2 -2
- package/cjs/is-object.js +2 -1
- package/cjs/merge.js +1 -1
- package/cjs/type-guards.js +2 -1
- package/esm/clone.js +2 -2
- package/esm/is-object.js +2 -1
- package/esm/merge.js +1 -1
- package/esm/type-guards.js +2 -1
- package/package.json +1 -1
- package/types/clone.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
-
### [v1.6.
|
|
3
|
+
### [v1.6.3](https://github.com/panates/jsopen-objects/compare/v1.6.2...v1.6.3) -
|
|
4
4
|
|
|
5
|
-
####
|
|
5
|
+
#### 🪲 Fixes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- fix: merge fails on null fields @Eray Hanoğlu
|
package/cjs/clone.js
CHANGED
package/cjs/is-object.js
CHANGED
|
@@ -7,7 +7,8 @@ function isObject(v) {
|
|
|
7
7
|
return v && typeof v === 'object' && !Array.isArray(v);
|
|
8
8
|
}
|
|
9
9
|
function isPlainObject(obj) {
|
|
10
|
-
if (
|
|
10
|
+
if (obj &&
|
|
11
|
+
typeof obj === 'object' &&
|
|
11
12
|
Object.prototype.toString.call(obj) === '[object Object]') {
|
|
12
13
|
const proto = Object.getPrototypeOf(obj);
|
|
13
14
|
/* istanbul ignore next */
|
package/cjs/merge.js
CHANGED
|
@@ -67,7 +67,7 @@ let trgVal;
|
|
|
67
67
|
};
|
|
68
68
|
if (options?.deep) {
|
|
69
69
|
if (options.deep === 'full') {
|
|
70
|
-
context.deepTest = v => typeof v === 'object' && !(0, type_guards_js_1.isBuiltIn)(v);
|
|
70
|
+
context.deepTest = v => v && typeof v === 'object' && !(0, type_guards_js_1.isBuiltIn)(v);
|
|
71
71
|
}
|
|
72
72
|
scriptL0.push(`let subPath;`, `let _isArray;`);
|
|
73
73
|
if (typeof options?.deep === 'function') {
|
package/cjs/type-guards.js
CHANGED
|
@@ -5,7 +5,8 @@ exports.isConstructor = isConstructor;
|
|
|
5
5
|
exports.isIterable = isIterable;
|
|
6
6
|
exports.isAsyncIterable = isAsyncIterable;
|
|
7
7
|
function isBuiltIn(v) {
|
|
8
|
-
return ((
|
|
8
|
+
return ((v &&
|
|
9
|
+
typeof v === 'object' &&
|
|
9
10
|
(v instanceof Date ||
|
|
10
11
|
v instanceof RegExp ||
|
|
11
12
|
v instanceof Map ||
|
package/esm/clone.js
CHANGED
package/esm/is-object.js
CHANGED
|
@@ -3,7 +3,8 @@ export function isObject(v) {
|
|
|
3
3
|
return v && typeof v === 'object' && !Array.isArray(v);
|
|
4
4
|
}
|
|
5
5
|
export function isPlainObject(obj) {
|
|
6
|
-
if (
|
|
6
|
+
if (obj &&
|
|
7
|
+
typeof obj === 'object' &&
|
|
7
8
|
Object.prototype.toString.call(obj) === '[object Object]') {
|
|
8
9
|
const proto = Object.getPrototypeOf(obj);
|
|
9
10
|
/* istanbul ignore next */
|
package/esm/merge.js
CHANGED
|
@@ -63,7 +63,7 @@ let trgVal;
|
|
|
63
63
|
};
|
|
64
64
|
if (options?.deep) {
|
|
65
65
|
if (options.deep === 'full') {
|
|
66
|
-
context.deepTest = v => typeof v === 'object' && !isBuiltIn(v);
|
|
66
|
+
context.deepTest = v => v && typeof v === 'object' && !isBuiltIn(v);
|
|
67
67
|
}
|
|
68
68
|
scriptL0.push(`let subPath;`, `let _isArray;`);
|
|
69
69
|
if (typeof options?.deep === 'function') {
|
package/esm/type-guards.js
CHANGED
package/package.json
CHANGED
package/types/clone.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StrictOmit } from 'ts-gems';
|
|
1
2
|
import { merge } from './merge.js';
|
|
2
3
|
export declare function clone<T extends object>(obj: T, options?: merge.Options): T;
|
|
3
|
-
export declare function deepClone<T extends object>(obj: T): T;
|
|
4
|
+
export declare function deepClone<T extends object>(obj: T, options?: StrictOmit<merge.Options, 'deep'>): T;
|