extra-utils 5.3.0 → 5.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/LICENSE +0 -0
- package/README.md +4 -0
- package/lib/array/index.d.ts +2 -2
- package/lib/array/index.js +2 -2
- package/lib/array/is-array.d.ts +2 -2
- package/lib/array/is-array.js +6 -6
- package/lib/array/is-empty-array.d.ts +3 -3
- package/lib/array/is-empty-array.js +6 -6
- package/lib/array-like/first.d.ts +1 -1
- package/lib/array-like/first.js +5 -5
- package/lib/array-like/index.d.ts +2 -2
- package/lib/array-like/index.js +2 -2
- package/lib/array-like/last.d.ts +1 -1
- package/lib/array-like/last.js +5 -5
- package/lib/boolean/index.d.ts +2 -2
- package/lib/boolean/index.js +2 -2
- package/lib/boolean/is-boolean.d.ts +2 -2
- package/lib/boolean/is-boolean.js +6 -6
- package/lib/boolean/is-falsy.d.ts +3 -3
- package/lib/boolean/is-falsy.js +6 -6
- package/lib/in-enum.d.ts +2 -2
- package/lib/in-enum.js +6 -6
- package/lib/index.d.ts +15 -15
- package/lib/index.js +15 -15
- package/lib/is-date.d.ts +2 -2
- package/lib/is-date.js +6 -6
- package/lib/is-function.d.ts +2 -2
- package/lib/is-function.js +6 -6
- package/lib/is-regexp.d.ts +2 -2
- package/lib/is-regexp.js +6 -6
- package/lib/is-symbol.d.ts +2 -2
- package/lib/is-symbol.js +6 -6
- package/lib/json/index.d.ts +2 -2
- package/lib/json/index.js +2 -2
- package/lib/json/is-json-serializable.d.ts +3 -3
- package/lib/json/is-json-serializable.js +10 -10
- package/lib/json/is-json-value.d.ts +3 -3
- package/lib/json/is-json-value.js +17 -17
- package/lib/nullish/index.d.ts +3 -3
- package/lib/nullish/index.js +3 -3
- package/lib/nullish/is-null.d.ts +2 -2
- package/lib/nullish/is-null.js +6 -6
- package/lib/nullish/is-nullish.d.ts +3 -3
- package/lib/nullish/is-nullish.js +9 -9
- package/lib/nullish/is-undefined.d.ts +2 -2
- package/lib/nullish/is-undefined.js +6 -6
- package/lib/number/index.d.ts +5 -5
- package/lib/number/index.js +5 -5
- package/lib/number/is-bigint.d.ts +2 -2
- package/lib/number/is-bigint.js +6 -6
- package/lib/number/is-finite.d.ts +1 -1
- package/lib/number/is-finite.js +3 -3
- package/lib/number/is-infinity.d.ts +2 -2
- package/lib/number/is-infinity.js +6 -6
- package/lib/number/is-nan.d.ts +2 -2
- package/lib/number/is-nan.js +6 -6
- package/lib/number/is-number.d.ts +2 -2
- package/lib/number/is-number.js +6 -6
- package/lib/object/index.d.ts +6 -3
- package/lib/object/index.js +6 -3
- package/lib/object/index.js.map +1 -1
- package/lib/object/is-deep-equal.d.ts +1 -0
- package/lib/object/is-deep-equal.js +21 -0
- package/lib/object/is-deep-equal.js.map +1 -0
- package/lib/object/is-empty-object.d.ts +2 -2
- package/lib/object/is-empty-object.js +6 -6
- package/lib/object/is-object.d.ts +2 -2
- package/lib/object/is-object.js +7 -7
- package/lib/object/is-plain-object.d.ts +2 -2
- package/lib/object/is-plain-object.js +7 -7
- package/lib/object/is-reference-equal.d.ts +1 -0
- package/lib/object/is-reference-equal.js +4 -0
- package/lib/object/is-reference-equal.js.map +1 -0
- package/lib/object/is-shallow-equal.d.ts +1 -0
- package/lib/object/is-shallow-equal.js +21 -0
- package/lib/object/is-shallow-equal.js.map +1 -0
- package/lib/pipe-async.d.ts +44 -44
- package/lib/pipe-async.js +7 -7
- package/lib/pipe.d.ts +43 -43
- package/lib/pipe.js +7 -7
- package/lib/string/index.d.ts +8 -8
- package/lib/string/index.js +8 -8
- package/lib/string/is-char.d.ts +2 -2
- package/lib/string/is-char.js +8 -8
- package/lib/string/is-string.d.ts +2 -2
- package/lib/string/is-string.js +6 -6
- package/lib/string/is-url-string.d.ts +2 -2
- package/lib/string/is-url-string.js +12 -12
- package/lib/string/remove-blank-lines.d.ts +1 -1
- package/lib/string/remove-blank-lines.js +7 -7
- package/lib/string/remove-extra-indents.d.ts +3 -3
- package/lib/string/remove-extra-indents.js +20 -20
- package/lib/string/remove-leading-blank-lines.d.ts +1 -1
- package/lib/string/remove-leading-blank-lines.js +12 -12
- package/lib/string/remove-trailing-blank-lines.d.ts +1 -1
- package/lib/string/remove-trailing-blank-lines.js +12 -12
- package/lib/string/to-string.d.ts +1 -1
- package/lib/string/to-string.js +3 -3
- package/lib/string/utils.d.ts +2 -2
- package/lib/string/utils.js +6 -6
- package/package.json +18 -18
- package/src/object/index.ts +3 -0
- package/src/object/is-deep-equal.ts +26 -0
- package/src/object/is-reference-equal.ts +3 -0
- package/src/object/is-shallow-equal.ts +26 -0
- package/CHANGELOG.md +0 -538
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -92,6 +92,10 @@ function isntPlainObject<T>(
|
|
|
92
92
|
|
|
93
93
|
function isEmptyObject(val: object): boolean
|
|
94
94
|
function isntEmptyObject(val: object): boolean
|
|
95
|
+
|
|
96
|
+
function isReferenceEqual(a: unknown, b: unknown): boolean
|
|
97
|
+
function isShallowEqual(a: unknown, b: unknown): boolean
|
|
98
|
+
function isDeepEqual(a: unknown, b: unknown): boolean
|
|
95
99
|
```
|
|
96
100
|
|
|
97
101
|
### String
|
package/lib/array/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './is-array.js';
|
|
2
|
-
export * from './is-empty-array.js';
|
|
1
|
+
export * from './is-array.js';
|
|
2
|
+
export * from './is-empty-array.js';
|
package/lib/array/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './is-array.js';
|
|
2
|
-
export * from './is-empty-array.js';
|
|
1
|
+
export * from './is-array.js';
|
|
2
|
+
export * from './is-empty-array.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/array/is-array.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isArray<T>(val: unknown): val is Array<T>;
|
|
2
|
-
export declare function isntArray<T>(val: T): val is Exclude<T, Array<unknown>>;
|
|
1
|
+
export declare function isArray<T>(val: unknown): val is Array<T>;
|
|
2
|
+
export declare function isntArray<T>(val: T): val is Exclude<T, Array<unknown>>;
|
package/lib/array/is-array.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isArray(val) {
|
|
2
|
-
return Array.isArray(val);
|
|
3
|
-
}
|
|
4
|
-
export function isntArray(val) {
|
|
5
|
-
return !isArray(val);
|
|
6
|
-
}
|
|
1
|
+
export function isArray(val) {
|
|
2
|
+
return Array.isArray(val);
|
|
3
|
+
}
|
|
4
|
+
export function isntArray(val) {
|
|
5
|
+
return !isArray(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-array.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NonEmptyArray } from 'justypes';
|
|
2
|
-
export declare function isEmptyArray(val: unknown[]): boolean;
|
|
3
|
-
export declare function isntEmptyArray<T>(val: T[]): val is NonEmptyArray<T>;
|
|
1
|
+
import { NonEmptyArray } from 'justypes';
|
|
2
|
+
export declare function isEmptyArray(val: unknown[]): boolean;
|
|
3
|
+
export declare function isntEmptyArray<T>(val: T[]): val is NonEmptyArray<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isEmptyArray(val) {
|
|
2
|
-
return val.length === 0;
|
|
3
|
-
}
|
|
4
|
-
export function isntEmptyArray(val) {
|
|
5
|
-
return val.length !== 0;
|
|
6
|
-
}
|
|
1
|
+
export function isEmptyArray(val) {
|
|
2
|
+
return val.length === 0;
|
|
3
|
+
}
|
|
4
|
+
export function isntEmptyArray(val) {
|
|
5
|
+
return val.length !== 0;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-empty-array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function first<T>(arr: ArrayLike<T>): T | undefined;
|
|
1
|
+
export declare function first<T>(arr: ArrayLike<T>): T | undefined;
|
package/lib/array-like/first.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function first(arr) {
|
|
2
|
-
return arr.length
|
|
3
|
-
? arr[0]
|
|
4
|
-
: undefined;
|
|
5
|
-
}
|
|
1
|
+
export function first(arr) {
|
|
2
|
+
return arr.length
|
|
3
|
+
? arr[0]
|
|
4
|
+
: undefined;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=first.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './first.js';
|
|
2
|
-
export * from './last.js';
|
|
1
|
+
export * from './first.js';
|
|
2
|
+
export * from './last.js';
|
package/lib/array-like/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './first.js';
|
|
2
|
-
export * from './last.js';
|
|
1
|
+
export * from './first.js';
|
|
2
|
+
export * from './last.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/array-like/last.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function last<T>(arr: ArrayLike<T>): T | undefined;
|
|
1
|
+
export declare function last<T>(arr: ArrayLike<T>): T | undefined;
|
package/lib/array-like/last.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function last(arr) {
|
|
2
|
-
return arr.length
|
|
3
|
-
? arr[arr.length - 1]
|
|
4
|
-
: undefined;
|
|
5
|
-
}
|
|
1
|
+
export function last(arr) {
|
|
2
|
+
return arr.length
|
|
3
|
+
? arr[arr.length - 1]
|
|
4
|
+
: undefined;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=last.js.map
|
package/lib/boolean/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './is-boolean.js';
|
|
2
|
-
export * from './is-falsy.js';
|
|
1
|
+
export * from './is-boolean.js';
|
|
2
|
+
export * from './is-falsy.js';
|
package/lib/boolean/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './is-boolean.js';
|
|
2
|
-
export * from './is-falsy.js';
|
|
1
|
+
export * from './is-boolean.js';
|
|
2
|
+
export * from './is-falsy.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isBoolean(val: unknown): val is boolean;
|
|
2
|
-
export declare function isntBoolean<T>(val: unknown): val is Exclude<T, boolean>;
|
|
1
|
+
export declare function isBoolean(val: unknown): val is boolean;
|
|
2
|
+
export declare function isntBoolean<T>(val: unknown): val is Exclude<T, boolean>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isBoolean(val) {
|
|
2
|
-
return typeof val === 'boolean';
|
|
3
|
-
}
|
|
4
|
-
export function isntBoolean(val) {
|
|
5
|
-
return !isBoolean(val);
|
|
6
|
-
}
|
|
1
|
+
export function isBoolean(val) {
|
|
2
|
+
return typeof val === 'boolean';
|
|
3
|
+
}
|
|
4
|
+
export function isntBoolean(val) {
|
|
5
|
+
return !isBoolean(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-boolean.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Falsy } from 'justypes';
|
|
2
|
-
export declare function isFalsy(val: unknown): val is Falsy;
|
|
3
|
-
export declare function isntFalsy<T>(val: T): val is Exclude<T, Falsy>;
|
|
1
|
+
import { Falsy } from 'justypes';
|
|
2
|
+
export declare function isFalsy(val: unknown): val is Falsy;
|
|
3
|
+
export declare function isntFalsy<T>(val: T): val is Exclude<T, Falsy>;
|
package/lib/boolean/is-falsy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isFalsy(val) {
|
|
2
|
-
return !val;
|
|
3
|
-
}
|
|
4
|
-
export function isntFalsy(val) {
|
|
5
|
-
return !isFalsy(val);
|
|
6
|
-
}
|
|
1
|
+
export function isFalsy(val) {
|
|
2
|
+
return !val;
|
|
3
|
+
}
|
|
4
|
+
export function isntFalsy(val) {
|
|
5
|
+
return !isFalsy(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-falsy.js.map
|
package/lib/in-enum.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function inEnum<T>(val: unknown, _enum: object): val is T;
|
|
2
|
-
export declare function notInEnum<T, U>(val: T, _enum: object): val is Exclude<T, U>;
|
|
1
|
+
export declare function inEnum<T>(val: unknown, _enum: object): val is T;
|
|
2
|
+
export declare function notInEnum<T, U>(val: T, _enum: object): val is Exclude<T, U>;
|
package/lib/in-enum.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function inEnum(val, _enum) {
|
|
2
|
-
return Object.values(_enum).includes(val);
|
|
3
|
-
}
|
|
4
|
-
export function notInEnum(val, _enum) {
|
|
5
|
-
return !inEnum(val, _enum);
|
|
6
|
-
}
|
|
1
|
+
export function inEnum(val, _enum) {
|
|
2
|
+
return Object.values(_enum).includes(val);
|
|
3
|
+
}
|
|
4
|
+
export function notInEnum(val, _enum) {
|
|
5
|
+
return !inEnum(val, _enum);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=in-enum.js.map
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './array-like/index.js';
|
|
2
|
-
export * from './array/index.js';
|
|
3
|
-
export * from './boolean/index.js';
|
|
4
|
-
export * from './number/index.js';
|
|
5
|
-
export * from './object/index.js';
|
|
6
|
-
export * from './json/index.js';
|
|
7
|
-
export * from './string/index.js';
|
|
8
|
-
export * from './nullish/index.js';
|
|
9
|
-
export * from './in-enum.js';
|
|
10
|
-
export * from './is-regexp.js';
|
|
11
|
-
export * from './is-symbol.js';
|
|
12
|
-
export * from './is-date.js';
|
|
13
|
-
export * from './is-function.js';
|
|
14
|
-
export * from './pipe.js';
|
|
15
|
-
export * from './pipe-async.js';
|
|
1
|
+
export * from './array-like/index.js';
|
|
2
|
+
export * from './array/index.js';
|
|
3
|
+
export * from './boolean/index.js';
|
|
4
|
+
export * from './number/index.js';
|
|
5
|
+
export * from './object/index.js';
|
|
6
|
+
export * from './json/index.js';
|
|
7
|
+
export * from './string/index.js';
|
|
8
|
+
export * from './nullish/index.js';
|
|
9
|
+
export * from './in-enum.js';
|
|
10
|
+
export * from './is-regexp.js';
|
|
11
|
+
export * from './is-symbol.js';
|
|
12
|
+
export * from './is-date.js';
|
|
13
|
+
export * from './is-function.js';
|
|
14
|
+
export * from './pipe.js';
|
|
15
|
+
export * from './pipe-async.js';
|
package/lib/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './array-like/index.js';
|
|
2
|
-
export * from './array/index.js';
|
|
3
|
-
export * from './boolean/index.js';
|
|
4
|
-
export * from './number/index.js';
|
|
5
|
-
export * from './object/index.js';
|
|
6
|
-
export * from './json/index.js';
|
|
7
|
-
export * from './string/index.js';
|
|
8
|
-
export * from './nullish/index.js';
|
|
9
|
-
export * from './in-enum.js';
|
|
10
|
-
export * from './is-regexp.js';
|
|
11
|
-
export * from './is-symbol.js';
|
|
12
|
-
export * from './is-date.js';
|
|
13
|
-
export * from './is-function.js';
|
|
14
|
-
export * from './pipe.js';
|
|
15
|
-
export * from './pipe-async.js';
|
|
1
|
+
export * from './array-like/index.js';
|
|
2
|
+
export * from './array/index.js';
|
|
3
|
+
export * from './boolean/index.js';
|
|
4
|
+
export * from './number/index.js';
|
|
5
|
+
export * from './object/index.js';
|
|
6
|
+
export * from './json/index.js';
|
|
7
|
+
export * from './string/index.js';
|
|
8
|
+
export * from './nullish/index.js';
|
|
9
|
+
export * from './in-enum.js';
|
|
10
|
+
export * from './is-regexp.js';
|
|
11
|
+
export * from './is-symbol.js';
|
|
12
|
+
export * from './is-date.js';
|
|
13
|
+
export * from './is-function.js';
|
|
14
|
+
export * from './pipe.js';
|
|
15
|
+
export * from './pipe-async.js';
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/lib/is-date.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isDate(val: unknown): val is Date;
|
|
2
|
-
export declare function isntDate<T>(val: T): val is Exclude<T, Date>;
|
|
1
|
+
export declare function isDate(val: unknown): val is Date;
|
|
2
|
+
export declare function isntDate<T>(val: T): val is Exclude<T, Date>;
|
package/lib/is-date.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isDate(val) {
|
|
2
|
-
return val instanceof Date;
|
|
3
|
-
}
|
|
4
|
-
export function isntDate(val) {
|
|
5
|
-
return !isDate(val);
|
|
6
|
-
}
|
|
1
|
+
export function isDate(val) {
|
|
2
|
+
return val instanceof Date;
|
|
3
|
+
}
|
|
4
|
+
export function isntDate(val) {
|
|
5
|
+
return !isDate(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-date.js.map
|
package/lib/is-function.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isFunction<T extends Function = (...args: any[]) => any>(val: unknown): val is T;
|
|
2
|
-
export declare function isntFunction<T>(val: T): val is Exclude<T, Function>;
|
|
1
|
+
export declare function isFunction<T extends Function = (...args: any[]) => any>(val: unknown): val is T;
|
|
2
|
+
export declare function isntFunction<T>(val: T): val is Exclude<T, Function>;
|
package/lib/is-function.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isFunction(val) {
|
|
2
|
-
return typeof val === 'function';
|
|
3
|
-
}
|
|
4
|
-
export function isntFunction(val) {
|
|
5
|
-
return !isFunction(val);
|
|
6
|
-
}
|
|
1
|
+
export function isFunction(val) {
|
|
2
|
+
return typeof val === 'function';
|
|
3
|
+
}
|
|
4
|
+
export function isntFunction(val) {
|
|
5
|
+
return !isFunction(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-function.js.map
|
package/lib/is-regexp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isRegExp(val: unknown): val is RegExp;
|
|
2
|
-
export declare function isntRegExp<T>(val: T): val is Exclude<T, RegExp>;
|
|
1
|
+
export declare function isRegExp(val: unknown): val is RegExp;
|
|
2
|
+
export declare function isntRegExp<T>(val: T): val is Exclude<T, RegExp>;
|
package/lib/is-regexp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isRegExp(val) {
|
|
2
|
-
return val instanceof RegExp;
|
|
3
|
-
}
|
|
4
|
-
export function isntRegExp(val) {
|
|
5
|
-
return !isRegExp(val);
|
|
6
|
-
}
|
|
1
|
+
export function isRegExp(val) {
|
|
2
|
+
return val instanceof RegExp;
|
|
3
|
+
}
|
|
4
|
+
export function isntRegExp(val) {
|
|
5
|
+
return !isRegExp(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-regexp.js.map
|
package/lib/is-symbol.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isSymbol(val: unknown): val is symbol;
|
|
2
|
-
export declare function isntSymbol<T>(val: T): val is Exclude<T, symbol>;
|
|
1
|
+
export declare function isSymbol(val: unknown): val is symbol;
|
|
2
|
+
export declare function isntSymbol<T>(val: T): val is Exclude<T, symbol>;
|
package/lib/is-symbol.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isSymbol(val) {
|
|
2
|
-
return typeof val === 'symbol';
|
|
3
|
-
}
|
|
4
|
-
export function isntSymbol(val) {
|
|
5
|
-
return !isSymbol(val);
|
|
6
|
-
}
|
|
1
|
+
export function isSymbol(val) {
|
|
2
|
+
return typeof val === 'symbol';
|
|
3
|
+
}
|
|
4
|
+
export function isntSymbol(val) {
|
|
5
|
+
return !isSymbol(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-symbol.js.map
|
package/lib/json/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './is-json-value.js';
|
|
2
|
-
export * from './is-json-serializable.js';
|
|
1
|
+
export * from './is-json-value.js';
|
|
2
|
+
export * from './is-json-serializable.js';
|
package/lib/json/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './is-json-value.js';
|
|
2
|
-
export * from './is-json-serializable.js';
|
|
1
|
+
export * from './is-json-value.js';
|
|
2
|
+
export * from './is-json-serializable.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JSONValue, JSONSerializable } from 'justypes';
|
|
2
|
-
export declare function isJSONSerializable<T extends JSONValue | Record<string, JSONValue | JSONSerializable<any>> | Array<JSONValue | JSONSerializable<any>>>(val: unknown): val is JSONSerializable<T>;
|
|
3
|
-
export declare function isntJSONSerializable<T>(val: T): val is Exclude<T, JSONSerializable<any>>;
|
|
1
|
+
import { JSONValue, JSONSerializable } from 'justypes';
|
|
2
|
+
export declare function isJSONSerializable<T extends JSONValue | Record<string, JSONValue | JSONSerializable<any>> | Array<JSONValue | JSONSerializable<any>>>(val: unknown): val is JSONSerializable<T>;
|
|
3
|
+
export declare function isntJSONSerializable<T>(val: T): val is Exclude<T, JSONSerializable<any>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { isObject } from "../object/index.js";
|
|
2
|
-
import { isFunction } from "../is-function.js";
|
|
3
|
-
export function isJSONSerializable(val) {
|
|
4
|
-
return isObject(val)
|
|
5
|
-
&& 'toJSON' in val
|
|
6
|
-
&& isFunction(val.toJSON);
|
|
7
|
-
}
|
|
8
|
-
export function isntJSONSerializable(val) {
|
|
9
|
-
return !isJSONSerializable(val);
|
|
10
|
-
}
|
|
1
|
+
import { isObject } from "../object/index.js";
|
|
2
|
+
import { isFunction } from "../is-function.js";
|
|
3
|
+
export function isJSONSerializable(val) {
|
|
4
|
+
return isObject(val)
|
|
5
|
+
&& 'toJSON' in val
|
|
6
|
+
&& isFunction(val.toJSON);
|
|
7
|
+
}
|
|
8
|
+
export function isntJSONSerializable(val) {
|
|
9
|
+
return !isJSONSerializable(val);
|
|
10
|
+
}
|
|
11
11
|
//# sourceMappingURL=is-json-serializable.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JSONValue } from 'justypes';
|
|
2
|
-
export declare function isJSONValue(val: unknown): val is JSONValue;
|
|
3
|
-
export declare function isntJSONValue<T>(val: T): val is Exclude<T, JSONValue>;
|
|
1
|
+
import { JSONValue } from 'justypes';
|
|
2
|
+
export declare function isJSONValue(val: unknown): val is JSONValue;
|
|
3
|
+
export declare function isntJSONValue<T>(val: T): val is Exclude<T, JSONValue>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { isNull } from "../nullish/index.js";
|
|
2
|
-
import { isBoolean } from "../boolean/index.js";
|
|
3
|
-
import { isString } from "../string/index.js";
|
|
4
|
-
import { isNumber } from "../number/index.js";
|
|
5
|
-
import { isArray } from "../array/index.js";
|
|
6
|
-
import { isPlainObject } from "../object/index.js";
|
|
7
|
-
export function isJSONValue(val) {
|
|
8
|
-
return isNull(val)
|
|
9
|
-
|| isBoolean(val)
|
|
10
|
-
|| isString(val)
|
|
11
|
-
|| isNumber(val)
|
|
12
|
-
|| (isArray(val) && val.every(isJSONValue))
|
|
13
|
-
|| (isPlainObject(val) && Object.values(val).every(isJSONValue));
|
|
14
|
-
}
|
|
15
|
-
export function isntJSONValue(val) {
|
|
16
|
-
return !isJSONValue(val);
|
|
17
|
-
}
|
|
1
|
+
import { isNull } from "../nullish/index.js";
|
|
2
|
+
import { isBoolean } from "../boolean/index.js";
|
|
3
|
+
import { isString } from "../string/index.js";
|
|
4
|
+
import { isNumber } from "../number/index.js";
|
|
5
|
+
import { isArray } from "../array/index.js";
|
|
6
|
+
import { isPlainObject } from "../object/index.js";
|
|
7
|
+
export function isJSONValue(val) {
|
|
8
|
+
return isNull(val)
|
|
9
|
+
|| isBoolean(val)
|
|
10
|
+
|| isString(val)
|
|
11
|
+
|| isNumber(val)
|
|
12
|
+
|| (isArray(val) && val.every(isJSONValue))
|
|
13
|
+
|| (isPlainObject(val) && Object.values(val).every(isJSONValue));
|
|
14
|
+
}
|
|
15
|
+
export function isntJSONValue(val) {
|
|
16
|
+
return !isJSONValue(val);
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=is-json-value.js.map
|
package/lib/nullish/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './is-null.js';
|
|
2
|
-
export * from './is-undefined.js';
|
|
3
|
-
export * from './is-nullish.js';
|
|
1
|
+
export * from './is-null.js';
|
|
2
|
+
export * from './is-undefined.js';
|
|
3
|
+
export * from './is-nullish.js';
|
package/lib/nullish/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './is-null.js';
|
|
2
|
-
export * from './is-undefined.js';
|
|
3
|
-
export * from './is-nullish.js';
|
|
1
|
+
export * from './is-null.js';
|
|
2
|
+
export * from './is-undefined.js';
|
|
3
|
+
export * from './is-nullish.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/lib/nullish/is-null.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isNull(val: unknown): val is null;
|
|
2
|
-
export declare function isntNull<T>(val: T): val is Exclude<T, null>;
|
|
1
|
+
export declare function isNull(val: unknown): val is null;
|
|
2
|
+
export declare function isntNull<T>(val: T): val is Exclude<T, null>;
|
package/lib/nullish/is-null.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isNull(val) {
|
|
2
|
-
return val === null;
|
|
3
|
-
}
|
|
4
|
-
export function isntNull(val) {
|
|
5
|
-
return !isNull(val);
|
|
6
|
-
}
|
|
1
|
+
export function isNull(val) {
|
|
2
|
+
return val === null;
|
|
3
|
+
}
|
|
4
|
+
export function isntNull(val) {
|
|
5
|
+
return !isNull(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-null.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Nullish } from 'justypes';
|
|
2
|
-
export declare function isNullish(val: unknown): val is Nullish;
|
|
3
|
-
export declare function isntNullish<T>(val: T): val is Exclude<T, Nullish>;
|
|
1
|
+
import { Nullish } from 'justypes';
|
|
2
|
+
export declare function isNullish(val: unknown): val is Nullish;
|
|
3
|
+
export declare function isntNullish<T>(val: T): val is Exclude<T, Nullish>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isNull } from './is-null.js';
|
|
2
|
-
import { isUndefined } from './is-undefined.js';
|
|
3
|
-
export function isNullish(val) {
|
|
4
|
-
return isNull(val)
|
|
5
|
-
|| isUndefined(val);
|
|
6
|
-
}
|
|
7
|
-
export function isntNullish(val) {
|
|
8
|
-
return !isNullish(val);
|
|
9
|
-
}
|
|
1
|
+
import { isNull } from './is-null.js';
|
|
2
|
+
import { isUndefined } from './is-undefined.js';
|
|
3
|
+
export function isNullish(val) {
|
|
4
|
+
return isNull(val)
|
|
5
|
+
|| isUndefined(val);
|
|
6
|
+
}
|
|
7
|
+
export function isntNullish(val) {
|
|
8
|
+
return !isNullish(val);
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=is-nullish.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isUndefined(val: unknown): val is undefined;
|
|
2
|
-
export declare function isntUndefined<T>(val: T): val is Exclude<T, undefined>;
|
|
1
|
+
export declare function isUndefined(val: unknown): val is undefined;
|
|
2
|
+
export declare function isntUndefined<T>(val: T): val is Exclude<T, undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isUndefined(val) {
|
|
2
|
-
return val === undefined;
|
|
3
|
-
}
|
|
4
|
-
export function isntUndefined(val) {
|
|
5
|
-
return !isUndefined(val);
|
|
6
|
-
}
|
|
1
|
+
export function isUndefined(val) {
|
|
2
|
+
return val === undefined;
|
|
3
|
+
}
|
|
4
|
+
export function isntUndefined(val) {
|
|
5
|
+
return !isUndefined(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-undefined.js.map
|
package/lib/number/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './is-bigint.js';
|
|
2
|
-
export * from './is-finite.js';
|
|
3
|
-
export * from './is-infinity.js';
|
|
4
|
-
export * from './is-nan.js';
|
|
5
|
-
export * from './is-number.js';
|
|
1
|
+
export * from './is-bigint.js';
|
|
2
|
+
export * from './is-finite.js';
|
|
3
|
+
export * from './is-infinity.js';
|
|
4
|
+
export * from './is-nan.js';
|
|
5
|
+
export * from './is-number.js';
|
package/lib/number/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './is-bigint.js';
|
|
2
|
-
export * from './is-finite.js';
|
|
3
|
-
export * from './is-infinity.js';
|
|
4
|
-
export * from './is-nan.js';
|
|
5
|
-
export * from './is-number.js';
|
|
1
|
+
export * from './is-bigint.js';
|
|
2
|
+
export * from './is-finite.js';
|
|
3
|
+
export * from './is-infinity.js';
|
|
4
|
+
export * from './is-nan.js';
|
|
5
|
+
export * from './is-number.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isBigInt(val: unknown): val is bigint;
|
|
2
|
-
export declare function isntBigInt<T>(val: T): val is Exclude<T, bigint>;
|
|
1
|
+
export declare function isBigInt(val: unknown): val is bigint;
|
|
2
|
+
export declare function isntBigInt<T>(val: T): val is Exclude<T, bigint>;
|
package/lib/number/is-bigint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isBigInt(val) {
|
|
2
|
-
return typeof val === 'bigint';
|
|
3
|
-
}
|
|
4
|
-
export function isntBigInt(val) {
|
|
5
|
-
return !isBigInt(val);
|
|
6
|
-
}
|
|
1
|
+
export function isBigInt(val) {
|
|
2
|
+
return typeof val === 'bigint';
|
|
3
|
+
}
|
|
4
|
+
export function isntBigInt(val) {
|
|
5
|
+
return !isBigInt(val);
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-bigint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isFinite(val: number): boolean;
|
|
1
|
+
export declare function isFinite(val: number): boolean;
|
package/lib/number/is-finite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function isFinite(val) {
|
|
2
|
-
return Number.isFinite(val);
|
|
3
|
-
}
|
|
1
|
+
export function isFinite(val) {
|
|
2
|
+
return Number.isFinite(val);
|
|
3
|
+
}
|
|
4
4
|
//# sourceMappingURL=is-finite.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isPositiveInfinity(val: number): boolean;
|
|
2
|
-
export declare function isNegativeInfinity(val: number): boolean;
|
|
1
|
+
export declare function isPositiveInfinity(val: number): boolean;
|
|
2
|
+
export declare function isNegativeInfinity(val: number): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function isPositiveInfinity(val) {
|
|
2
|
-
return val === Infinity;
|
|
3
|
-
}
|
|
4
|
-
export function isNegativeInfinity(val) {
|
|
5
|
-
return val === -Infinity;
|
|
6
|
-
}
|
|
1
|
+
export function isPositiveInfinity(val) {
|
|
2
|
+
return val === Infinity;
|
|
3
|
+
}
|
|
4
|
+
export function isNegativeInfinity(val) {
|
|
5
|
+
return val === -Infinity;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=is-infinity.js.map
|
package/lib/number/is-nan.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function isNaN(val: number): boolean;
|
|
2
|
-
export declare function isntNaN(val: number): boolean;
|
|
1
|
+
export declare function isNaN(val: number): boolean;
|
|
2
|
+
export declare function isntNaN(val: number): boolean;
|