@valkyriestudios/utils 12.4.0 → 12.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.
- package/README.md +9 -1
- package/array/index.d.ts +10 -0
- package/array/index.js +25 -0
- package/boolean/index.d.ts +2 -0
- package/boolean/index.js +6 -0
- package/caching/index.d.ts +2 -0
- package/caching/index.js +5 -0
- package/date/index.d.ts +11 -0
- package/date/index.js +24 -0
- package/deep/index.d.ts +5 -0
- package/deep/index.js +15 -0
- package/formdata/index.d.ts +2 -0
- package/formdata/index.js +6 -0
- package/formdata/is.d.ts +9 -0
- package/formdata/is.js +8 -0
- package/function/index.d.ts +7 -0
- package/function/index.js +19 -0
- package/hash/index.d.ts +3 -0
- package/hash/index.js +7 -0
- package/index.d.ts +326 -236
- package/is.d.ts +50 -64
- package/is.js +57 -71
- package/number/index.d.ts +18 -0
- package/number/index.js +57 -0
- package/object/index.d.ts +6 -0
- package/object/index.js +17 -0
- package/package.json +1 -1
- package/regexp/index.d.ts +3 -0
- package/regexp/index.js +9 -0
- package/string/index.d.ts +7 -0
- package/string/index.js +20 -0
package/index.d.ts
CHANGED
|
@@ -6,185 +6,6 @@ declare module "equal" {
|
|
|
6
6
|
function equal(a: any, b: any): boolean;
|
|
7
7
|
export { equal, equal as default };
|
|
8
8
|
}
|
|
9
|
-
declare module "array/isNotEmpty" {
|
|
10
|
-
function isNotEmptyArray(val: unknown): val is unknown[];
|
|
11
|
-
export { isNotEmptyArray, isNotEmptyArray as default };
|
|
12
|
-
}
|
|
13
|
-
declare module "array/is" {
|
|
14
|
-
function isArray(val: unknown): val is unknown[];
|
|
15
|
-
export { isArray, isArray as default };
|
|
16
|
-
}
|
|
17
|
-
declare module "boolean/is" {
|
|
18
|
-
function isBoolean(val: unknown): val is boolean;
|
|
19
|
-
export { isBoolean, isBoolean as default };
|
|
20
|
-
}
|
|
21
|
-
declare module "date/is" {
|
|
22
|
-
function isDate(val: unknown): val is Date;
|
|
23
|
-
export { isDate, isDate as default };
|
|
24
|
-
}
|
|
25
|
-
declare module "function/is" {
|
|
26
|
-
function isFunction(val: unknown): val is (...args: unknown[]) => unknown;
|
|
27
|
-
export { isFunction, isFunction as default };
|
|
28
|
-
}
|
|
29
|
-
declare module "function/isAsync" {
|
|
30
|
-
function isAsyncFunction(val: unknown): val is (...args: unknown[]) => Promise<unknown>;
|
|
31
|
-
export { isAsyncFunction, isAsyncFunction as default };
|
|
32
|
-
}
|
|
33
|
-
declare module "number/is" {
|
|
34
|
-
function isNumber(val: unknown): val is number;
|
|
35
|
-
export { isNumber, isNumber as default };
|
|
36
|
-
}
|
|
37
|
-
declare module "number/isBetween" {
|
|
38
|
-
function isNumberBetween(val: unknown, min: number, max: number): val is number;
|
|
39
|
-
export { isNumberBetween, isNumberBetween as default };
|
|
40
|
-
}
|
|
41
|
-
declare module "number/isBelow" {
|
|
42
|
-
function isNumberBelow(val: unknown, ref: number): val is number;
|
|
43
|
-
export { isNumberBelow, isNumberBelow as default };
|
|
44
|
-
}
|
|
45
|
-
declare module "number/isBelowOrEqual" {
|
|
46
|
-
function isNumberBelowOrEqual(val: unknown, ref: number): val is number;
|
|
47
|
-
export { isNumberBelowOrEqual, isNumberBelowOrEqual as default };
|
|
48
|
-
}
|
|
49
|
-
declare module "number/isAbove" {
|
|
50
|
-
function isNumberAbove(val: unknown, ref: number): val is number;
|
|
51
|
-
export { isNumberAbove, isNumberAbove as default };
|
|
52
|
-
}
|
|
53
|
-
declare module "number/isAboveOrEqual" {
|
|
54
|
-
function isNumberAboveOrEqual(val: unknown, ref: number): val is number;
|
|
55
|
-
export { isNumberAboveOrEqual, isNumberAboveOrEqual as default };
|
|
56
|
-
}
|
|
57
|
-
declare module "number/isInteger" {
|
|
58
|
-
function isInteger(val: unknown): val is number;
|
|
59
|
-
export { isInteger, isInteger as default };
|
|
60
|
-
}
|
|
61
|
-
declare module "number/isIntegerBetween" {
|
|
62
|
-
function isIntegerBetween(val: unknown, min: number, max: number): val is number;
|
|
63
|
-
export { isIntegerBetween, isIntegerBetween as default };
|
|
64
|
-
}
|
|
65
|
-
declare module "number/isIntegerBelow" {
|
|
66
|
-
function isIntegerBelow(val: unknown, ref: number): val is number;
|
|
67
|
-
export { isIntegerBelow, isIntegerBelow as default };
|
|
68
|
-
}
|
|
69
|
-
declare module "number/isIntegerBelowOrEqual" {
|
|
70
|
-
function isIntegerBelowOrEqual(val: unknown, ref: number): val is number;
|
|
71
|
-
export { isIntegerBelowOrEqual, isIntegerBelowOrEqual as default };
|
|
72
|
-
}
|
|
73
|
-
declare module "number/isIntegerAbove" {
|
|
74
|
-
function isIntegerAbove(val: unknown, ref: number): val is number;
|
|
75
|
-
export { isIntegerAbove, isIntegerAbove as default };
|
|
76
|
-
}
|
|
77
|
-
declare module "number/isIntegerAboveOrEqual" {
|
|
78
|
-
function isIntegerAboveOrEqual(val: unknown, ref: number): val is number;
|
|
79
|
-
export { isIntegerAboveOrEqual, isIntegerAboveOrEqual as default };
|
|
80
|
-
}
|
|
81
|
-
declare module "regexp/is" {
|
|
82
|
-
function isRegExp(val: unknown): val is RegExp;
|
|
83
|
-
export { isRegExp, isRegExp as default };
|
|
84
|
-
}
|
|
85
|
-
declare module "object/is" {
|
|
86
|
-
function isObject(val: unknown): val is {
|
|
87
|
-
[key: string]: any;
|
|
88
|
-
};
|
|
89
|
-
export { isObject, isObject as default };
|
|
90
|
-
}
|
|
91
|
-
declare module "object/isNotEmpty" {
|
|
92
|
-
function isNotEmptyObject(val: unknown): val is {
|
|
93
|
-
[key: string]: any;
|
|
94
|
-
};
|
|
95
|
-
export { isNotEmptyObject, isNotEmptyObject as default };
|
|
96
|
-
}
|
|
97
|
-
declare module "string/is" {
|
|
98
|
-
function isString(val: unknown): val is string;
|
|
99
|
-
export { isString, isString as default };
|
|
100
|
-
}
|
|
101
|
-
declare module "string/isBetween" {
|
|
102
|
-
function isStringBetween(val: unknown, min: number, max: number, trimmed?: boolean): val is string;
|
|
103
|
-
export { isStringBetween, isStringBetween as default };
|
|
104
|
-
}
|
|
105
|
-
declare module "string/isNotEmpty" {
|
|
106
|
-
function isNotEmptyString(val: unknown, trimmed?: boolean): val is string;
|
|
107
|
-
export { isNotEmptyString, isNotEmptyString as default };
|
|
108
|
-
}
|
|
109
|
-
declare module "is" {
|
|
110
|
-
import { equal } from "equal";
|
|
111
|
-
import { isNotEmptyArray } from "array/isNotEmpty";
|
|
112
|
-
import { isArray } from "array/is";
|
|
113
|
-
import { isBoolean } from "boolean/is";
|
|
114
|
-
import { isDate } from "date/is";
|
|
115
|
-
import { isFunction } from "function/is";
|
|
116
|
-
import { isAsyncFunction } from "function/isAsync";
|
|
117
|
-
import { isNumber } from "number/is";
|
|
118
|
-
import { isNumberBetween } from "number/isBetween";
|
|
119
|
-
import { isNumberBelow } from "number/isBelow";
|
|
120
|
-
import { isNumberBelowOrEqual } from "number/isBelowOrEqual";
|
|
121
|
-
import { isNumberAbove } from "number/isAbove";
|
|
122
|
-
import { isNumberAboveOrEqual } from "number/isAboveOrEqual";
|
|
123
|
-
import { isInteger } from "number/isInteger";
|
|
124
|
-
import { isIntegerBetween } from "number/isIntegerBetween";
|
|
125
|
-
import { isIntegerBelow } from "number/isIntegerBelow";
|
|
126
|
-
import { isIntegerBelowOrEqual } from "number/isIntegerBelowOrEqual";
|
|
127
|
-
import { isIntegerAbove } from "number/isIntegerAbove";
|
|
128
|
-
import { isIntegerAboveOrEqual } from "number/isIntegerAboveOrEqual";
|
|
129
|
-
import { isRegExp } from "regexp/is";
|
|
130
|
-
import { isObject } from "object/is";
|
|
131
|
-
import { isNotEmptyObject } from "object/isNotEmpty";
|
|
132
|
-
import { isString } from "string/is";
|
|
133
|
-
import { isStringBetween } from "string/isBetween";
|
|
134
|
-
import { isNotEmptyString } from "string/isNotEmpty";
|
|
135
|
-
const Is: Readonly<{
|
|
136
|
-
Array: typeof isArray;
|
|
137
|
-
NeArray: typeof isNotEmptyArray;
|
|
138
|
-
NotEmptyArray: typeof isNotEmptyArray;
|
|
139
|
-
Boolean: typeof isBoolean;
|
|
140
|
-
Date: typeof isDate;
|
|
141
|
-
Function: typeof isFunction;
|
|
142
|
-
AsyncFunction: typeof isAsyncFunction;
|
|
143
|
-
Num: typeof isNumber;
|
|
144
|
-
NumBetween: typeof isNumberBetween;
|
|
145
|
-
NumAbove: typeof isNumberAbove;
|
|
146
|
-
NumAboveOrEqual: typeof isNumberAboveOrEqual;
|
|
147
|
-
NumBelow: typeof isNumberBelow;
|
|
148
|
-
NumBelowOrEqual: typeof isNumberBelowOrEqual;
|
|
149
|
-
NumGt: typeof isNumberAbove;
|
|
150
|
-
NumGte: typeof isNumberAboveOrEqual;
|
|
151
|
-
NumLt: typeof isNumberBelow;
|
|
152
|
-
NumLte: typeof isNumberBelowOrEqual;
|
|
153
|
-
Number: typeof isNumber;
|
|
154
|
-
NumberBetween: typeof isNumberBetween;
|
|
155
|
-
NumberAbove: typeof isNumberAbove;
|
|
156
|
-
NumberAboveOrEqual: typeof isNumberAboveOrEqual;
|
|
157
|
-
NumberBelow: typeof isNumberBelow;
|
|
158
|
-
NumberBelowOrEqual: typeof isNumberBelowOrEqual;
|
|
159
|
-
Int: typeof isInteger;
|
|
160
|
-
IntBetween: typeof isIntegerBetween;
|
|
161
|
-
IntAbove: typeof isIntegerAbove;
|
|
162
|
-
IntAboveOrEqual: typeof isIntegerAboveOrEqual;
|
|
163
|
-
IntBelow: typeof isIntegerBelow;
|
|
164
|
-
IntBelowOrEqual: typeof isIntegerBelowOrEqual;
|
|
165
|
-
IntGt: typeof isIntegerAbove;
|
|
166
|
-
IntGte: typeof isIntegerAboveOrEqual;
|
|
167
|
-
IntLt: typeof isIntegerBelow;
|
|
168
|
-
IntLte: typeof isIntegerBelowOrEqual;
|
|
169
|
-
Integer: typeof isInteger;
|
|
170
|
-
IntegerBetween: typeof isIntegerBetween;
|
|
171
|
-
IntegerBelow: typeof isIntegerBelow;
|
|
172
|
-
IntegerBelowOrEqual: typeof isIntegerBelowOrEqual;
|
|
173
|
-
IntegerAbove: typeof isIntegerAbove;
|
|
174
|
-
IntegerAboveOrEqual: typeof isIntegerAboveOrEqual;
|
|
175
|
-
RegExp: typeof isRegExp;
|
|
176
|
-
Object: typeof isObject;
|
|
177
|
-
NeObject: typeof isNotEmptyObject;
|
|
178
|
-
NotEmptyObject: typeof isNotEmptyObject;
|
|
179
|
-
String: typeof isString;
|
|
180
|
-
StringBetween: typeof isStringBetween;
|
|
181
|
-
NeString: typeof isNotEmptyString;
|
|
182
|
-
NotEmptyString: typeof isNotEmptyString;
|
|
183
|
-
Equal: typeof equal;
|
|
184
|
-
Eq: typeof equal;
|
|
185
|
-
}>;
|
|
186
|
-
export { Is, Is as default };
|
|
187
|
-
}
|
|
188
9
|
declare module "hash/fnv1A" {
|
|
189
10
|
function fnv1A(data: unknown, offset?: number): number;
|
|
190
11
|
export { fnv1A, fnv1A as default };
|
|
@@ -193,6 +14,14 @@ declare module "array/dedupe" {
|
|
|
193
14
|
function dedupe<T>(val: T[]): T[];
|
|
194
15
|
export { dedupe, dedupe as default };
|
|
195
16
|
}
|
|
17
|
+
declare module "array/is" {
|
|
18
|
+
function isArray(val: unknown): val is unknown[];
|
|
19
|
+
export { isArray, isArray as default };
|
|
20
|
+
}
|
|
21
|
+
declare module "array/isNotEmpty" {
|
|
22
|
+
function isNotEmptyArray(val: unknown): val is unknown[];
|
|
23
|
+
export { isNotEmptyArray, isNotEmptyArray as default };
|
|
24
|
+
}
|
|
196
25
|
declare module "number/round" {
|
|
197
26
|
function round(val: number, precision?: number): number;
|
|
198
27
|
export { round, round as default };
|
|
@@ -236,6 +65,12 @@ declare module "array/shuffle" {
|
|
|
236
65
|
function shuffle(arr: unknown[]): void;
|
|
237
66
|
export { shuffle, shuffle as default };
|
|
238
67
|
}
|
|
68
|
+
declare module "object/isNotEmpty" {
|
|
69
|
+
function isNotEmptyObject(val: unknown): val is {
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
};
|
|
72
|
+
export { isNotEmptyObject, isNotEmptyObject as default };
|
|
73
|
+
}
|
|
239
74
|
declare module "array/sort" {
|
|
240
75
|
interface sortOptions {
|
|
241
76
|
filter_fn?: (el: any) => boolean;
|
|
@@ -249,9 +84,29 @@ declare module "array/sort" {
|
|
|
249
84
|
function sort(arr: sortObject[], by: string | sortByFunction, dir?: 'asc' | 'desc', opts?: sortOptions): sortObject[];
|
|
250
85
|
export { sort, sort as default };
|
|
251
86
|
}
|
|
252
|
-
declare module "
|
|
253
|
-
|
|
254
|
-
|
|
87
|
+
declare module "array/index" {
|
|
88
|
+
import { dedupe } from "array/dedupe";
|
|
89
|
+
import { isArray } from "array/is";
|
|
90
|
+
import { isNotEmptyArray } from "array/isNotEmpty";
|
|
91
|
+
import { join } from "array/join";
|
|
92
|
+
import { mapFn } from "array/mapFn";
|
|
93
|
+
import { mapKey } from "array/mapKey";
|
|
94
|
+
import { mapPrimitive } from "array/mapPrimitive";
|
|
95
|
+
import { shuffle } from "array/shuffle";
|
|
96
|
+
import { sort } from "array/sort";
|
|
97
|
+
export { dedupe, isArray, isArray as is, isNotEmptyArray, isNotEmptyArray as isNotEmpty, isNotEmptyArray as isNeArray, isNotEmptyArray as isNe, join, mapFn, mapKey, mapPrimitive, shuffle, sort };
|
|
98
|
+
}
|
|
99
|
+
declare module "boolean/is" {
|
|
100
|
+
function isBoolean(val: unknown): val is boolean;
|
|
101
|
+
export { isBoolean, isBoolean as default };
|
|
102
|
+
}
|
|
103
|
+
declare module "boolean/index" {
|
|
104
|
+
import { isBoolean } from "boolean/is";
|
|
105
|
+
export { isBoolean, isBoolean as is };
|
|
106
|
+
}
|
|
107
|
+
declare module "date/is" {
|
|
108
|
+
function isDate(val: unknown): val is Date;
|
|
109
|
+
export { isDate, isDate as default };
|
|
255
110
|
}
|
|
256
111
|
declare module "date/addUTC" {
|
|
257
112
|
function addUTC(val: Date, amt?: number, key?: 'years' | 'year' | 'months' | 'month' | 'days' | 'day' | 'hours' | 'hour' | 'minutes' | 'minute' | 'seconds' | 'second' | 'milliseconds' | 'millisecond'): Date;
|
|
@@ -281,53 +136,42 @@ declare module "date/startOfUTC" {
|
|
|
281
136
|
function startOfUTC(val: Date, key?: 'year' | 'quarter' | 'month' | 'week' | 'week_sun' | 'week_mon' | 'week_tue' | 'week_wed' | 'week_thu' | 'week_fri' | 'week_sat' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'): Date;
|
|
282
137
|
export { startOfUTC, startOfUTC as default };
|
|
283
138
|
}
|
|
139
|
+
declare module "date/toUnix" {
|
|
140
|
+
function toUnix(val: Date): number;
|
|
141
|
+
export { toUnix, toUnix as default };
|
|
142
|
+
}
|
|
284
143
|
declare module "date/toUTC" {
|
|
285
144
|
function toUTC(val: Date): Date;
|
|
286
145
|
export { toUTC, toUTC as default };
|
|
287
146
|
}
|
|
288
|
-
declare module "date/
|
|
289
|
-
|
|
290
|
-
|
|
147
|
+
declare module "date/index" {
|
|
148
|
+
import { addUTC } from "date/addUTC";
|
|
149
|
+
import { diff } from "date/diff";
|
|
150
|
+
import { endOfUTC } from "date/endOfUTC";
|
|
151
|
+
import { format } from "date/format";
|
|
152
|
+
import { isDate } from "date/is";
|
|
153
|
+
import { nowUnix } from "date/nowUnix";
|
|
154
|
+
import { nowUnixMs } from "date/nowUnixMs";
|
|
155
|
+
import { startOfUTC } from "date/startOfUTC";
|
|
156
|
+
import { toUnix } from "date/toUnix";
|
|
157
|
+
import { toUTC } from "date/toUTC";
|
|
158
|
+
export { addUTC, diff, endOfUTC, format, isDate, isDate as is, nowUnix, nowUnixMs, startOfUTC, toUnix, toUTC };
|
|
291
159
|
}
|
|
292
|
-
declare module "
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
} | {
|
|
296
|
-
[key: string]: any;
|
|
297
|
-
}[] | any[];
|
|
298
|
-
type Frozen<T> = {
|
|
299
|
-
readonly [K in keyof T]: Frozen<T[K]>;
|
|
300
|
-
};
|
|
301
|
-
function deepFreeze<T extends deepInput>(obj: T): Frozen<T>;
|
|
302
|
-
export { deepFreeze, deepFreeze as default };
|
|
160
|
+
declare module "formdata/is" {
|
|
161
|
+
function isFormData(val: unknown): val is FormData;
|
|
162
|
+
export { isFormData, isFormData as default };
|
|
303
163
|
}
|
|
304
|
-
declare module "
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
} | {
|
|
308
|
-
[key: string]: any;
|
|
309
|
-
}[] | any[], path: string, get_parent?: boolean): any | undefined;
|
|
310
|
-
export { deepGet, deepGet as default };
|
|
164
|
+
declare module "formdata/index" {
|
|
165
|
+
import { isFormData } from "formdata/is";
|
|
166
|
+
export { isFormData, isFormData as is };
|
|
311
167
|
}
|
|
312
|
-
declare module "
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
} | {
|
|
316
|
-
[key: string]: any;
|
|
317
|
-
}[] | any[];
|
|
318
|
-
type Sealed<T> = {
|
|
319
|
-
[K in keyof T]: Sealed<T[K]>;
|
|
320
|
-
};
|
|
321
|
-
function deepSeal<T extends deepInput>(obj: T): Sealed<T>;
|
|
322
|
-
export { deepSeal, deepSeal as default };
|
|
168
|
+
declare module "function/is" {
|
|
169
|
+
function isFunction(val: unknown): val is (...args: unknown[]) => unknown;
|
|
170
|
+
export { isFunction, isFunction as default };
|
|
323
171
|
}
|
|
324
|
-
declare module "
|
|
325
|
-
function
|
|
326
|
-
|
|
327
|
-
} | {
|
|
328
|
-
[key: string]: any;
|
|
329
|
-
}[] | any[], path: string, value: any, define?: boolean): boolean;
|
|
330
|
-
export { deepSet, deepSet as default };
|
|
172
|
+
declare module "function/isAsync" {
|
|
173
|
+
function isAsyncFunction(val: unknown): val is (...args: unknown[]) => Promise<unknown>;
|
|
174
|
+
export { isAsyncFunction, isAsyncFunction as default };
|
|
331
175
|
}
|
|
332
176
|
declare module "function/noop" {
|
|
333
177
|
function noop(): void;
|
|
@@ -345,21 +189,27 @@ declare module "function/sleep" {
|
|
|
345
189
|
function sleep(ms?: number): Promise<void>;
|
|
346
190
|
export { sleep, sleep as default };
|
|
347
191
|
}
|
|
348
|
-
declare module "
|
|
349
|
-
|
|
350
|
-
|
|
192
|
+
declare module "function/index" {
|
|
193
|
+
import { isFunction } from "function/is";
|
|
194
|
+
import { isAsyncFunction } from "function/isAsync";
|
|
195
|
+
import { noop } from "function/noop";
|
|
196
|
+
import { noopresolve } from "function/noopresolve";
|
|
197
|
+
import { noopreturn } from "function/noopreturn";
|
|
198
|
+
import { sleep } from "function/sleep";
|
|
199
|
+
export { isFunction, isFunction as is, isFunction as isFn, isAsyncFunction, isAsyncFunction as isAsync, isAsyncFunction as isAsyncFn, noop, noopresolve, noopreturn, sleep };
|
|
351
200
|
}
|
|
352
|
-
declare module "
|
|
353
|
-
function
|
|
354
|
-
export {
|
|
201
|
+
declare module "regexp/is" {
|
|
202
|
+
function isRegExp(val: unknown): val is RegExp;
|
|
203
|
+
export { isRegExp, isRegExp as default };
|
|
355
204
|
}
|
|
356
|
-
declare module "
|
|
357
|
-
function
|
|
358
|
-
export {
|
|
205
|
+
declare module "regexp/sanitize" {
|
|
206
|
+
function sanitizeRegExp(val: string): string | false;
|
|
207
|
+
export { sanitizeRegExp, sanitizeRegExp as default };
|
|
359
208
|
}
|
|
360
|
-
declare module "
|
|
361
|
-
|
|
362
|
-
|
|
209
|
+
declare module "regexp/index" {
|
|
210
|
+
import { isRegExp } from "regexp/is";
|
|
211
|
+
import { sanitizeRegExp } from "regexp/sanitize";
|
|
212
|
+
export { isRegExp, isRegExp as is, sanitizeRegExp, sanitizeRegExp as sanitize };
|
|
363
213
|
}
|
|
364
214
|
declare module "object/define" {
|
|
365
215
|
function define(props: {
|
|
@@ -371,6 +221,12 @@ declare module "object/define" {
|
|
|
371
221
|
};
|
|
372
222
|
export { define, define as default };
|
|
373
223
|
}
|
|
224
|
+
declare module "object/is" {
|
|
225
|
+
function isObject(val: unknown): val is {
|
|
226
|
+
[key: string]: any;
|
|
227
|
+
};
|
|
228
|
+
export { isObject, isObject as default };
|
|
229
|
+
}
|
|
374
230
|
declare module "object/merge" {
|
|
375
231
|
function merge(target: {
|
|
376
232
|
[key: string]: any;
|
|
@@ -381,6 +237,22 @@ declare module "object/merge" {
|
|
|
381
237
|
};
|
|
382
238
|
export { merge, merge as default };
|
|
383
239
|
}
|
|
240
|
+
declare module "deep/get" {
|
|
241
|
+
function deepGet(obj: {
|
|
242
|
+
[key: string]: any;
|
|
243
|
+
} | {
|
|
244
|
+
[key: string]: any;
|
|
245
|
+
}[] | any[], path: string, get_parent?: boolean): any | undefined;
|
|
246
|
+
export { deepGet, deepGet as default };
|
|
247
|
+
}
|
|
248
|
+
declare module "deep/set" {
|
|
249
|
+
function deepSet(obj: {
|
|
250
|
+
[key: string]: any;
|
|
251
|
+
} | {
|
|
252
|
+
[key: string]: any;
|
|
253
|
+
}[] | any[], path: string, value: any, define?: boolean): boolean;
|
|
254
|
+
export { deepSet, deepSet as default };
|
|
255
|
+
}
|
|
384
256
|
declare module "object/pick" {
|
|
385
257
|
function pick(obj: {
|
|
386
258
|
[key: string]: any;
|
|
@@ -389,9 +261,93 @@ declare module "object/pick" {
|
|
|
389
261
|
};
|
|
390
262
|
export { pick, pick as default };
|
|
391
263
|
}
|
|
392
|
-
declare module "
|
|
393
|
-
|
|
394
|
-
|
|
264
|
+
declare module "object/index" {
|
|
265
|
+
import { define } from "object/define";
|
|
266
|
+
import { isObject } from "object/is";
|
|
267
|
+
import { isNotEmptyObject } from "object/isNotEmpty";
|
|
268
|
+
import { merge } from "object/merge";
|
|
269
|
+
import { pick } from "object/pick";
|
|
270
|
+
export { define, isObject, isObject as is, isNotEmptyObject, isNotEmptyObject as isNotEmpty, isNotEmptyObject as isNeObject, isNotEmptyObject as isNe, merge, pick };
|
|
271
|
+
}
|
|
272
|
+
declare module "number/is" {
|
|
273
|
+
function isNumber(val: unknown): val is number;
|
|
274
|
+
export { isNumber, isNumber as default };
|
|
275
|
+
}
|
|
276
|
+
declare module "number/isAbove" {
|
|
277
|
+
function isNumberAbove(val: unknown, ref: number): val is number;
|
|
278
|
+
export { isNumberAbove, isNumberAbove as default };
|
|
279
|
+
}
|
|
280
|
+
declare module "number/isAboveOrEqual" {
|
|
281
|
+
function isNumberAboveOrEqual(val: unknown, ref: number): val is number;
|
|
282
|
+
export { isNumberAboveOrEqual, isNumberAboveOrEqual as default };
|
|
283
|
+
}
|
|
284
|
+
declare module "number/isBelow" {
|
|
285
|
+
function isNumberBelow(val: unknown, ref: number): val is number;
|
|
286
|
+
export { isNumberBelow, isNumberBelow as default };
|
|
287
|
+
}
|
|
288
|
+
declare module "number/isBelowOrEqual" {
|
|
289
|
+
function isNumberBelowOrEqual(val: unknown, ref: number): val is number;
|
|
290
|
+
export { isNumberBelowOrEqual, isNumberBelowOrEqual as default };
|
|
291
|
+
}
|
|
292
|
+
declare module "number/isBetween" {
|
|
293
|
+
function isNumberBetween(val: unknown, min: number, max: number): val is number;
|
|
294
|
+
export { isNumberBetween, isNumberBetween as default };
|
|
295
|
+
}
|
|
296
|
+
declare module "number/isInteger" {
|
|
297
|
+
function isInteger(val: unknown): val is number;
|
|
298
|
+
export { isInteger, isInteger as default };
|
|
299
|
+
}
|
|
300
|
+
declare module "number/isIntegerAbove" {
|
|
301
|
+
function isIntegerAbove(val: unknown, ref: number): val is number;
|
|
302
|
+
export { isIntegerAbove, isIntegerAbove as default };
|
|
303
|
+
}
|
|
304
|
+
declare module "number/isIntegerAboveOrEqual" {
|
|
305
|
+
function isIntegerAboveOrEqual(val: unknown, ref: number): val is number;
|
|
306
|
+
export { isIntegerAboveOrEqual, isIntegerAboveOrEqual as default };
|
|
307
|
+
}
|
|
308
|
+
declare module "number/isIntegerBelow" {
|
|
309
|
+
function isIntegerBelow(val: unknown, ref: number): val is number;
|
|
310
|
+
export { isIntegerBelow, isIntegerBelow as default };
|
|
311
|
+
}
|
|
312
|
+
declare module "number/isIntegerBelowOrEqual" {
|
|
313
|
+
function isIntegerBelowOrEqual(val: unknown, ref: number): val is number;
|
|
314
|
+
export { isIntegerBelowOrEqual, isIntegerBelowOrEqual as default };
|
|
315
|
+
}
|
|
316
|
+
declare module "number/isIntegerBetween" {
|
|
317
|
+
function isIntegerBetween(val: unknown, min: number, max: number): val is number;
|
|
318
|
+
export { isIntegerBetween, isIntegerBetween as default };
|
|
319
|
+
}
|
|
320
|
+
declare module "number/randomBetween" {
|
|
321
|
+
function randomBetween(min?: number, max?: number): number;
|
|
322
|
+
export { randomBetween, randomBetween as default };
|
|
323
|
+
}
|
|
324
|
+
declare module "number/randomIntBetween" {
|
|
325
|
+
function randomIntBetween(min?: number, max?: number): number;
|
|
326
|
+
export { randomIntBetween, randomIntBetween as default };
|
|
327
|
+
}
|
|
328
|
+
declare module "number/toPercentage" {
|
|
329
|
+
function toPercentage(val: number, precision?: number, min?: number, max?: number): number;
|
|
330
|
+
export { toPercentage, toPercentage as default };
|
|
331
|
+
}
|
|
332
|
+
declare module "number/index" {
|
|
333
|
+
import { isNumber } from "number/is";
|
|
334
|
+
import { isNumberAbove } from "number/isAbove";
|
|
335
|
+
import { isNumberAboveOrEqual } from "number/isAboveOrEqual";
|
|
336
|
+
import { isNumberBelow } from "number/isBelow";
|
|
337
|
+
import { isNumberBelowOrEqual } from "number/isBelowOrEqual";
|
|
338
|
+
import { isNumberBetween } from "number/isBetween";
|
|
339
|
+
import { isInteger } from "number/isInteger";
|
|
340
|
+
import { isIntegerAbove } from "number/isIntegerAbove";
|
|
341
|
+
import { isIntegerAboveOrEqual } from "number/isIntegerAboveOrEqual";
|
|
342
|
+
import { isIntegerBelow } from "number/isIntegerBelow";
|
|
343
|
+
import { isIntegerBelowOrEqual } from "number/isIntegerBelowOrEqual";
|
|
344
|
+
import { isIntegerBetween } from "number/isIntegerBetween";
|
|
345
|
+
import { isNumericalNaN } from "number/isNumericalNaN";
|
|
346
|
+
import { randomBetween } from "number/randomBetween";
|
|
347
|
+
import { randomIntBetween } from "number/randomIntBetween";
|
|
348
|
+
import { round } from "number/round";
|
|
349
|
+
import { toPercentage } from "number/toPercentage";
|
|
350
|
+
export { isNumber, isNumber as is, isNumber as isNum, isNumberAbove, isNumberAbove as isNumGt, isNumberAbove as isGt, isNumberAboveOrEqual, isNumberAboveOrEqual as isNumGte, isNumberAboveOrEqual as isGte, isNumberBelow, isNumberBelow as isNumLt, isNumberBelow as isLt, isNumberBelowOrEqual, isNumberBelowOrEqual as isNumLte, isNumberBelowOrEqual as isLte, isNumberBetween, isNumberBetween as isNumBetween, isInteger, isInteger as isInt, isIntegerAbove, isIntegerAbove as isIntGt, isIntegerAboveOrEqual, isIntegerAboveOrEqual as isIntGte, isIntegerBelow, isIntegerBelow as isIntLt, isIntegerBelowOrEqual, isIntegerBelowOrEqual as isIntLte, isIntegerBetween, isIntegerBetween as isIntBetween, isNumericalNaN, randomBetween, randomBetween as randBetween, randomIntBetween, randomIntBetween as randIntBetween, round, toPercentage, toPercentage as toPct };
|
|
395
351
|
}
|
|
396
352
|
declare module "string/humanizeNumber" {
|
|
397
353
|
interface humanizeNumberOptions {
|
|
@@ -415,7 +371,141 @@ declare module "string/humanizeBytes" {
|
|
|
415
371
|
function humanizeBytes(val: number | string, options?: humanizeBytesOptions): string;
|
|
416
372
|
export { humanizeBytes, humanizeBytes as default };
|
|
417
373
|
}
|
|
374
|
+
declare module "string/is" {
|
|
375
|
+
function isString(val: unknown): val is string;
|
|
376
|
+
export { isString, isString as default };
|
|
377
|
+
}
|
|
378
|
+
declare module "string/isNotEmpty" {
|
|
379
|
+
function isNotEmptyString(val: unknown, trimmed?: boolean): val is string;
|
|
380
|
+
export { isNotEmptyString, isNotEmptyString as default };
|
|
381
|
+
}
|
|
382
|
+
declare module "string/isBetween" {
|
|
383
|
+
function isStringBetween(val: unknown, min: number, max: number, trimmed?: boolean): val is string;
|
|
384
|
+
export { isStringBetween, isStringBetween as default };
|
|
385
|
+
}
|
|
418
386
|
declare module "string/shorten" {
|
|
419
387
|
function shorten(val: string, length: number, postfix?: string): string;
|
|
420
388
|
export { shorten, shorten as default };
|
|
421
389
|
}
|
|
390
|
+
declare module "string/index" {
|
|
391
|
+
import { humanizeBytes } from "string/humanizeBytes";
|
|
392
|
+
import { humanizeNumber } from "string/humanizeNumber";
|
|
393
|
+
import { isString } from "string/is";
|
|
394
|
+
import { isNotEmptyString } from "string/isNotEmpty";
|
|
395
|
+
import { isStringBetween } from "string/isBetween";
|
|
396
|
+
import { shorten } from "string/shorten";
|
|
397
|
+
export { humanizeBytes, humanizeNumber, isString, isString as is, isNotEmptyString, isNotEmptyString as isNotEmpty, isNotEmptyString as isNeString, isNotEmptyString as isNe, isStringBetween, isStringBetween as isBetween, shorten };
|
|
398
|
+
}
|
|
399
|
+
declare module "is" {
|
|
400
|
+
import { equal } from "equal";
|
|
401
|
+
import { isArray, isNeArray } from "array/index";
|
|
402
|
+
import { isBoolean } from "boolean/index";
|
|
403
|
+
import { isDate } from "date/index";
|
|
404
|
+
import { isFormData } from "formdata/index";
|
|
405
|
+
import { isFn, isAsyncFn } from "function/index";
|
|
406
|
+
import { isRegExp } from "regexp/index";
|
|
407
|
+
import { isObject, isNeObject } from "object/index";
|
|
408
|
+
import { isNum, isNumBetween, isNumLt, isNumLte, isNumGt, isNumGte, isInt, isIntBetween, isIntLt, isIntLte, isIntGt, isIntGte } from "number/index";
|
|
409
|
+
import { isString, isStringBetween, isNeString } from "string/index";
|
|
410
|
+
const Is: Readonly<{
|
|
411
|
+
Array: typeof isArray;
|
|
412
|
+
NeArray: typeof isNeArray;
|
|
413
|
+
NotEmptyArray: typeof isNeArray;
|
|
414
|
+
Boolean: typeof isBoolean;
|
|
415
|
+
Date: typeof isDate;
|
|
416
|
+
Formdata: typeof isFormData;
|
|
417
|
+
Function: typeof isFn;
|
|
418
|
+
AsyncFunction: typeof isAsyncFn;
|
|
419
|
+
Num: typeof isNum;
|
|
420
|
+
NumBetween: typeof isNumBetween;
|
|
421
|
+
NumAbove: typeof isNumGt;
|
|
422
|
+
NumAboveOrEqual: typeof isNumGte;
|
|
423
|
+
NumBelow: typeof isNumLt;
|
|
424
|
+
NumBelowOrEqual: typeof isNumLte;
|
|
425
|
+
NumGt: typeof isNumGt;
|
|
426
|
+
NumGte: typeof isNumGte;
|
|
427
|
+
NumLt: typeof isNumLt;
|
|
428
|
+
NumLte: typeof isNumLte;
|
|
429
|
+
Number: typeof isNum;
|
|
430
|
+
NumberBetween: typeof isNumBetween;
|
|
431
|
+
NumberAbove: typeof isNumGt;
|
|
432
|
+
NumberAboveOrEqual: typeof isNumGte;
|
|
433
|
+
NumberBelow: typeof isNumLt;
|
|
434
|
+
NumberBelowOrEqual: typeof isNumLte;
|
|
435
|
+
Int: typeof isInt;
|
|
436
|
+
IntBetween: typeof isIntBetween;
|
|
437
|
+
IntAbove: typeof isIntGt;
|
|
438
|
+
IntAboveOrEqual: typeof isIntGte;
|
|
439
|
+
IntBelow: typeof isIntLt;
|
|
440
|
+
IntBelowOrEqual: typeof isIntLte;
|
|
441
|
+
IntGt: typeof isIntGt;
|
|
442
|
+
IntGte: typeof isIntGte;
|
|
443
|
+
IntLt: typeof isIntLt;
|
|
444
|
+
IntLte: typeof isIntLte;
|
|
445
|
+
Integer: typeof isInt;
|
|
446
|
+
IntegerBetween: typeof isIntBetween;
|
|
447
|
+
IntegerBelow: typeof isIntLt;
|
|
448
|
+
IntegerBelowOrEqual: typeof isIntLte;
|
|
449
|
+
IntegerAbove: typeof isIntGt;
|
|
450
|
+
IntegerAboveOrEqual: typeof isIntGte;
|
|
451
|
+
RegExp: typeof isRegExp;
|
|
452
|
+
Object: typeof isObject;
|
|
453
|
+
NeObject: typeof isNeObject;
|
|
454
|
+
NotEmptyObject: typeof isNeObject;
|
|
455
|
+
String: typeof isString;
|
|
456
|
+
StringBetween: typeof isStringBetween;
|
|
457
|
+
NeString: typeof isNeString;
|
|
458
|
+
NotEmptyString: typeof isNeString;
|
|
459
|
+
Equal: typeof equal;
|
|
460
|
+
Eq: typeof equal;
|
|
461
|
+
}>;
|
|
462
|
+
export { Is, Is as default };
|
|
463
|
+
}
|
|
464
|
+
declare module "caching/memoize" {
|
|
465
|
+
function memoize(fn: Function, resolver?: Function): Function;
|
|
466
|
+
export { memoize, memoize as default };
|
|
467
|
+
}
|
|
468
|
+
declare module "caching/index" {
|
|
469
|
+
import { memoize } from "caching/memoize";
|
|
470
|
+
export { memoize };
|
|
471
|
+
}
|
|
472
|
+
declare module "deep/freeze" {
|
|
473
|
+
type deepInput = {
|
|
474
|
+
[key: string]: any;
|
|
475
|
+
} | {
|
|
476
|
+
[key: string]: any;
|
|
477
|
+
}[] | any[];
|
|
478
|
+
type Frozen<T> = {
|
|
479
|
+
readonly [K in keyof T]: Frozen<T[K]>;
|
|
480
|
+
};
|
|
481
|
+
function deepFreeze<T extends deepInput>(obj: T): Frozen<T>;
|
|
482
|
+
export { deepFreeze, deepFreeze as default };
|
|
483
|
+
}
|
|
484
|
+
declare module "deep/seal" {
|
|
485
|
+
type deepInput = {
|
|
486
|
+
[key: string]: any;
|
|
487
|
+
} | {
|
|
488
|
+
[key: string]: any;
|
|
489
|
+
}[] | any[];
|
|
490
|
+
type Sealed<T> = {
|
|
491
|
+
[K in keyof T]: Sealed<T[K]>;
|
|
492
|
+
};
|
|
493
|
+
function deepSeal<T extends deepInput>(obj: T): Sealed<T>;
|
|
494
|
+
export { deepSeal, deepSeal as default };
|
|
495
|
+
}
|
|
496
|
+
declare module "deep/index" {
|
|
497
|
+
import { deepFreeze } from "deep/freeze";
|
|
498
|
+
import { deepGet } from "deep/get";
|
|
499
|
+
import { deepSeal } from "deep/seal";
|
|
500
|
+
import { deepSet } from "deep/set";
|
|
501
|
+
export { deepFreeze as freeze, deepFreeze, deepGet as get, deepGet, deepSeal as seal, deepSeal, deepSet as set, deepSet };
|
|
502
|
+
}
|
|
503
|
+
declare module "hash/guid" {
|
|
504
|
+
function guid(): string;
|
|
505
|
+
export { guid, guid as default };
|
|
506
|
+
}
|
|
507
|
+
declare module "hash/index" {
|
|
508
|
+
import { fnv1A } from "hash/fnv1A";
|
|
509
|
+
import { guid } from "hash/guid";
|
|
510
|
+
export { fnv1A, guid };
|
|
511
|
+
}
|