@naturalcycles/js-lib 14.178.0 → 14.179.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/dist/is.util.d.ts +2 -2
- package/dist/is.util.js +3 -3
- package/dist-esm/is.util.js +3 -3
- package/package.json +1 -1
- package/src/is.util.ts +4 -4
package/dist/is.util.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export declare const _isFalsy: <T>(v: T) => v is Falsy<T>;
|
|
|
23
23
|
/**
|
|
24
24
|
* Returns true if item is Object, not null and not Array.
|
|
25
25
|
*/
|
|
26
|
-
export declare function _isObject(
|
|
26
|
+
export declare function _isObject(obj: any): obj is AnyObject;
|
|
27
27
|
export declare function _isPrimitive(v: any): v is Primitive;
|
|
28
|
-
export declare function _isEmptyObject(obj:
|
|
28
|
+
export declare function _isEmptyObject(obj: AnyObject): boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Object is considered empty if it's one of:
|
|
31
31
|
* undefined
|
package/dist/is.util.js
CHANGED
|
@@ -27,8 +27,8 @@ exports._isFalsy = _isFalsy;
|
|
|
27
27
|
/**
|
|
28
28
|
* Returns true if item is Object, not null and not Array.
|
|
29
29
|
*/
|
|
30
|
-
function _isObject(
|
|
31
|
-
return
|
|
30
|
+
function _isObject(obj) {
|
|
31
|
+
return obj?.constructor === Object;
|
|
32
32
|
}
|
|
33
33
|
exports._isObject = _isObject;
|
|
34
34
|
function _isPrimitive(v) {
|
|
@@ -42,7 +42,7 @@ function _isPrimitive(v) {
|
|
|
42
42
|
}
|
|
43
43
|
exports._isPrimitive = _isPrimitive;
|
|
44
44
|
function _isEmptyObject(obj) {
|
|
45
|
-
return
|
|
45
|
+
return Object.keys(obj).length === 0;
|
|
46
46
|
}
|
|
47
47
|
exports._isEmptyObject = _isEmptyObject;
|
|
48
48
|
/**
|
package/dist-esm/is.util.js
CHANGED
|
@@ -18,8 +18,8 @@ export const _isFalsy = (v) => !v;
|
|
|
18
18
|
/**
|
|
19
19
|
* Returns true if item is Object, not null and not Array.
|
|
20
20
|
*/
|
|
21
|
-
export function _isObject(
|
|
22
|
-
return (
|
|
21
|
+
export function _isObject(obj) {
|
|
22
|
+
return (obj === null || obj === void 0 ? void 0 : obj.constructor) === Object;
|
|
23
23
|
}
|
|
24
24
|
export function _isPrimitive(v) {
|
|
25
25
|
return (v === null ||
|
|
@@ -31,7 +31,7 @@ export function _isPrimitive(v) {
|
|
|
31
31
|
typeof v === 'symbol');
|
|
32
32
|
}
|
|
33
33
|
export function _isEmptyObject(obj) {
|
|
34
|
-
return
|
|
34
|
+
return Object.keys(obj).length === 0;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Object is considered empty if it's one of:
|
package/package.json
CHANGED
package/src/is.util.ts
CHANGED
|
@@ -27,8 +27,8 @@ export const _isFalsy = <T>(v: T): v is Falsy<T> => !v
|
|
|
27
27
|
/**
|
|
28
28
|
* Returns true if item is Object, not null and not Array.
|
|
29
29
|
*/
|
|
30
|
-
export function _isObject(
|
|
31
|
-
return
|
|
30
|
+
export function _isObject(obj: any): obj is AnyObject {
|
|
31
|
+
return obj?.constructor === Object
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
export function _isPrimitive(v: any): v is Primitive {
|
|
@@ -43,8 +43,8 @@ export function _isPrimitive(v: any): v is Primitive {
|
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function _isEmptyObject(obj:
|
|
47
|
-
return
|
|
46
|
+
export function _isEmptyObject(obj: AnyObject): boolean {
|
|
47
|
+
return Object.keys(obj).length === 0
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|