extra-utils 5.3.0 → 5.5.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.
Files changed (130) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +22 -2
  3. package/lib/array/index.d.ts +2 -2
  4. package/lib/array/index.js +2 -2
  5. package/lib/array/is-array.d.ts +2 -2
  6. package/lib/array/is-array.js +6 -6
  7. package/lib/array/is-empty-array.d.ts +3 -3
  8. package/lib/array/is-empty-array.js +6 -6
  9. package/lib/array-like/first.d.ts +1 -1
  10. package/lib/array-like/first.js +5 -5
  11. package/lib/array-like/index.d.ts +2 -2
  12. package/lib/array-like/index.js +2 -2
  13. package/lib/array-like/last.d.ts +1 -1
  14. package/lib/array-like/last.js +5 -5
  15. package/lib/boolean/index.d.ts +2 -2
  16. package/lib/boolean/index.js +2 -2
  17. package/lib/boolean/is-boolean.d.ts +2 -2
  18. package/lib/boolean/is-boolean.js +6 -6
  19. package/lib/boolean/is-falsy.d.ts +3 -3
  20. package/lib/boolean/is-falsy.js +6 -6
  21. package/lib/enum/enum-entries.d.ts +3 -0
  22. package/lib/enum/enum-entries.js +5 -0
  23. package/lib/enum/enum-entries.js.map +1 -0
  24. package/lib/enum/enum-keys.d.ts +1 -0
  25. package/lib/enum/enum-keys.js +5 -0
  26. package/lib/enum/enum-keys.js.map +1 -0
  27. package/lib/enum/enum-values.d.ts +1 -0
  28. package/lib/enum/enum-values.js +6 -0
  29. package/lib/enum/enum-values.js.map +1 -0
  30. package/lib/enum/in-enum.d.ts +2 -0
  31. package/lib/enum/in-enum.js +8 -0
  32. package/lib/enum/in-enum.js.map +1 -0
  33. package/lib/enum/index.d.ts +4 -0
  34. package/lib/enum/index.js +5 -0
  35. package/lib/enum/index.js.map +1 -0
  36. package/lib/index.d.ts +15 -15
  37. package/lib/index.js +15 -15
  38. package/lib/index.js.map +1 -1
  39. package/lib/is-date.d.ts +2 -2
  40. package/lib/is-date.js +6 -6
  41. package/lib/is-function.d.ts +2 -2
  42. package/lib/is-function.js +6 -6
  43. package/lib/is-regexp.d.ts +2 -2
  44. package/lib/is-regexp.js +6 -6
  45. package/lib/is-symbol.d.ts +2 -2
  46. package/lib/is-symbol.js +6 -6
  47. package/lib/json/index.d.ts +2 -2
  48. package/lib/json/index.js +2 -2
  49. package/lib/json/is-json-serializable.d.ts +3 -3
  50. package/lib/json/is-json-serializable.js +10 -10
  51. package/lib/json/is-json-value.d.ts +3 -3
  52. package/lib/json/is-json-value.js +17 -17
  53. package/lib/nullish/index.d.ts +3 -3
  54. package/lib/nullish/index.js +3 -3
  55. package/lib/nullish/is-null.d.ts +2 -2
  56. package/lib/nullish/is-null.js +6 -6
  57. package/lib/nullish/is-nullish.d.ts +3 -3
  58. package/lib/nullish/is-nullish.js +9 -9
  59. package/lib/nullish/is-undefined.d.ts +2 -2
  60. package/lib/nullish/is-undefined.js +6 -6
  61. package/lib/number/index.d.ts +5 -5
  62. package/lib/number/index.js +5 -5
  63. package/lib/number/is-bigint.d.ts +2 -2
  64. package/lib/number/is-bigint.js +6 -6
  65. package/lib/number/is-finite.d.ts +1 -1
  66. package/lib/number/is-finite.js +3 -3
  67. package/lib/number/is-infinity.d.ts +2 -2
  68. package/lib/number/is-infinity.js +6 -6
  69. package/lib/number/is-nan.d.ts +2 -2
  70. package/lib/number/is-nan.js +6 -6
  71. package/lib/number/is-number.d.ts +2 -2
  72. package/lib/number/is-number.js +6 -6
  73. package/lib/object/index.d.ts +6 -3
  74. package/lib/object/index.js +6 -3
  75. package/lib/object/index.js.map +1 -1
  76. package/lib/object/is-deep-equal.d.ts +1 -0
  77. package/lib/object/is-deep-equal.js +21 -0
  78. package/lib/object/is-deep-equal.js.map +1 -0
  79. package/lib/object/is-empty-object.d.ts +2 -2
  80. package/lib/object/is-empty-object.js +6 -6
  81. package/lib/object/is-object.d.ts +2 -2
  82. package/lib/object/is-object.js +7 -7
  83. package/lib/object/is-plain-object.d.ts +2 -2
  84. package/lib/object/is-plain-object.js +7 -7
  85. package/lib/object/is-reference-equal.d.ts +1 -0
  86. package/lib/object/is-reference-equal.js +4 -0
  87. package/lib/object/is-reference-equal.js.map +1 -0
  88. package/lib/object/is-shallow-equal.d.ts +1 -0
  89. package/lib/object/is-shallow-equal.js +21 -0
  90. package/lib/object/is-shallow-equal.js.map +1 -0
  91. package/lib/pipe-async.d.ts +44 -44
  92. package/lib/pipe-async.js +7 -7
  93. package/lib/pipe.d.ts +43 -43
  94. package/lib/pipe.js +7 -7
  95. package/lib/string/index.d.ts +8 -8
  96. package/lib/string/index.js +8 -8
  97. package/lib/string/is-char.d.ts +2 -2
  98. package/lib/string/is-char.js +8 -8
  99. package/lib/string/is-string.d.ts +2 -2
  100. package/lib/string/is-string.js +6 -6
  101. package/lib/string/is-url-string.d.ts +2 -2
  102. package/lib/string/is-url-string.js +12 -12
  103. package/lib/string/remove-blank-lines.d.ts +1 -1
  104. package/lib/string/remove-blank-lines.js +7 -7
  105. package/lib/string/remove-extra-indents.d.ts +3 -3
  106. package/lib/string/remove-extra-indents.js +20 -20
  107. package/lib/string/remove-leading-blank-lines.d.ts +1 -1
  108. package/lib/string/remove-leading-blank-lines.js +12 -12
  109. package/lib/string/remove-trailing-blank-lines.d.ts +1 -1
  110. package/lib/string/remove-trailing-blank-lines.js +12 -12
  111. package/lib/string/to-string.d.ts +1 -1
  112. package/lib/string/to-string.js +3 -3
  113. package/lib/string/utils.d.ts +2 -2
  114. package/lib/string/utils.js +6 -6
  115. package/package.json +1 -1
  116. package/src/enum/enum-entries.ts +7 -0
  117. package/src/enum/enum-keys.ts +6 -0
  118. package/src/enum/enum-values.ts +8 -0
  119. package/src/enum/in-enum.ts +16 -0
  120. package/src/enum/index.ts +4 -0
  121. package/src/index.ts +1 -1
  122. package/src/object/index.ts +3 -0
  123. package/src/object/is-deep-equal.ts +26 -0
  124. package/src/object/is-reference-equal.ts +3 -0
  125. package/src/object/is-shallow-equal.ts +26 -0
  126. package/CHANGELOG.md +0 -538
  127. package/lib/in-enum.d.ts +0 -2
  128. package/lib/in-enum.js +0 -7
  129. package/lib/in-enum.js.map +0 -1
  130. package/src/in-enum.ts +0 -10
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
@@ -187,8 +191,24 @@ removeTrailingBlankLines(
187
191
 
188
192
  ### Enum
189
193
  ```ts
190
- function inEnum<T>(val: unknown, _enum: object): val is T
191
- function notInEnum<T, U>(val: T, _enum: object): val is Exclude<T, U>
194
+ function inEnum<T extends Record<string | number, string | number>>(
195
+ val: string | number
196
+ , _enum: T
197
+ ): val is T[keyof T]
198
+ function notInEnum(
199
+ val: string | number
200
+ , _enum: Record<string | number, string | number>
201
+ ): boolean
202
+
203
+ function enumKeys<T extends Record<string | number, string | number>>(
204
+ _enum: T
205
+ ): Array<keyof T>
206
+ function enumValues<T extends Record<string | number, string | number>>(
207
+ _enum: T
208
+ ): Array<T[keyof T]>
209
+ function enumEntries<T extends Record<string | number, string | number>>(
210
+ _enum: T
211
+ ): Array<{ [Key in keyof T]: [Key, T[Key]] }[keyof T]>
192
212
  ```
193
213
 
194
214
  ### Date
@@ -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';
@@ -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
@@ -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>>;
@@ -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;
@@ -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';
@@ -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
@@ -1 +1 @@
1
- export declare function last<T>(arr: ArrayLike<T>): T | undefined;
1
+ export declare function last<T>(arr: ArrayLike<T>): T | undefined;
@@ -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
@@ -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';
@@ -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>;
@@ -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
@@ -0,0 +1,3 @@
1
+ export declare function enumEntries<T extends Record<string | number, string | number>>(_enum: T): Array<{
2
+ [Key in keyof T]: [Key, T[Key]];
3
+ }[keyof T]>;
@@ -0,0 +1,5 @@
1
+ import { enumKeys } from './enum-keys.js';
2
+ export function enumEntries(_enum) {
3
+ return enumKeys(_enum).map(key => [key, _enum[key]]);
4
+ }
5
+ //# sourceMappingURL=enum-entries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-entries.js","sourceRoot":"","sources":["../../src/enum/enum-entries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,UAAU,WAAW,CACzB,KAAQ;IAER,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACtD,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function enumKeys<T extends Record<string | number, string | number>>(_enum: T): Array<keyof T>;
@@ -0,0 +1,5 @@
1
+ export function enumKeys(_enum) {
2
+ return Object.keys(_enum)
3
+ .filter(key => Number.isNaN(Number(key)));
4
+ }
5
+ //# sourceMappingURL=enum-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-keys.js","sourceRoot":"","sources":["../../src/enum/enum-keys.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CACtB,KAAQ;IAER,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;SACtB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC7C,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function enumValues<T extends Record<string | number, string | number>>(_enum: T): Array<T[keyof T]>;
@@ -0,0 +1,6 @@
1
+ import { enumKeys } from './enum-keys.js';
2
+ export function enumValues(_enum) {
3
+ const keys = enumKeys(_enum);
4
+ return keys.map(key => _enum[key]);
5
+ }
6
+ //# sourceMappingURL=enum-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum-values.js","sourceRoot":"","sources":["../../src/enum/enum-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,UAAU,UAAU,CACxB,KAAQ;IAER,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;AACpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function inEnum<T extends Record<string | number, string | number>>(val: string | number, _enum: T): val is T[keyof T];
2
+ export declare function notInEnum(val: string | number, _enum: Record<string | number, string | number>): boolean;
@@ -0,0 +1,8 @@
1
+ import { enumValues } from './enum-values.js';
2
+ export function inEnum(val, _enum) {
3
+ return enumValues(_enum).includes(val);
4
+ }
5
+ export function notInEnum(val, _enum) {
6
+ return !inEnum(val, _enum);
7
+ }
8
+ //# sourceMappingURL=in-enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-enum.js","sourceRoot":"","sources":["../../src/enum/in-enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,UAAU,MAAM,CACpB,GAAoB,EACpB,KAAQ;IAER,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAiB,CAAC,CAAA;AACtD,CAAC;AAGD,MAAM,UAAU,SAAS,CACvB,GAAoB,EACpB,KAA+C;IAE/C,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './in-enum.js';
2
+ export * from './enum-keys.js';
3
+ export * from './enum-values.js';
4
+ export * from './enum-entries.js';
@@ -0,0 +1,5 @@
1
+ export * from './in-enum.js';
2
+ export * from './enum-keys.js';
3
+ export * from './enum-values.js';
4
+ export * from './enum-entries.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enum/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
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 './enum/index.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 './enum/index.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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA"}
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
@@ -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>;
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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';
@@ -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
@@ -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>;
@@ -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