foreslash 0.1.2 → 0.2.1
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/lib/index.cmn.cjs +408 -31
- package/lib/index.d.ts +583 -33
- package/lib/index.mjs +380 -32
- package/lib/index.umd.js +408 -31
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,141 @@
|
|
|
1
1
|
import { A, F } from 'ts-toolbelt';
|
|
2
2
|
|
|
3
|
+
type RangeOptions<T> = {
|
|
4
|
+
step?: number;
|
|
5
|
+
value?: T;
|
|
6
|
+
getter?: (index: number, existList: T[]) => T;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* 根据起止值生成一个数组, 步长默认为 1
|
|
10
|
+
* @param start 开始值
|
|
11
|
+
* @param end 结束值
|
|
12
|
+
* @example
|
|
13
|
+
* ```js
|
|
14
|
+
* range(1, 10) // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
15
|
+
* range(10, 1) // [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
|
|
16
|
+
* ```
|
|
17
|
+
* @version 0.2.0
|
|
18
|
+
*/
|
|
19
|
+
declare function range(start: number, end: number): number[];
|
|
20
|
+
/**
|
|
21
|
+
* 根据目标值生成一个数组, 步长默认为 1
|
|
22
|
+
* @param target 目标值
|
|
23
|
+
* @example
|
|
24
|
+
* ```js
|
|
25
|
+
* range(10) // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
26
|
+
* range(-10) // [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]
|
|
27
|
+
* ```
|
|
28
|
+
* @version 0.2.1
|
|
29
|
+
*/
|
|
30
|
+
declare function range(target: number): number[];
|
|
31
|
+
/**
|
|
32
|
+
* 根据起止值生成一个数组, 步长默认为 1
|
|
33
|
+
* @param start 开始值
|
|
34
|
+
* @param end 结束值
|
|
35
|
+
* @param step 步长, 默认为 1
|
|
36
|
+
* @example
|
|
37
|
+
* ```js
|
|
38
|
+
* range(1, 10, 2) // [1, 3, 5, 7, 9]
|
|
39
|
+
* range(10, 0, 2) // [10, 8, 6, 4, 2, 0]
|
|
40
|
+
* ```
|
|
41
|
+
* @version 0.2.0
|
|
42
|
+
*/
|
|
43
|
+
declare function range(start: number, end: number, step?: number): number[];
|
|
44
|
+
/**
|
|
45
|
+
* 根据起止值生成一个数组, 步长默认为 1
|
|
46
|
+
* @param start 开始值
|
|
47
|
+
* @param end 结束值
|
|
48
|
+
* @param options 详细配置项, 用法见下
|
|
49
|
+
* @example
|
|
50
|
+
* ```js
|
|
51
|
+
* range(1, 5, { step: 2 }) // [1, 3, 5]
|
|
52
|
+
* range(0, 6, { step: 2 }) // [0, 2, 4, 6]
|
|
53
|
+
* range(0, 6, { step: 2, value: 'test' }) // ['test', 'test', 'test', 'test']
|
|
54
|
+
* range(0, 6, { step: 2, getter: (i) => i * 10 }) // [0, 20, 40, 60]
|
|
55
|
+
* ```
|
|
56
|
+
* @version 0.2.0
|
|
57
|
+
*/
|
|
58
|
+
declare function range<T = number>(start: number, end: number, options?: RangeOptions<T>): T[];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 延迟一定时间
|
|
62
|
+
* @param time 延迟时间, 单位为毫秒(ms), 默认为 `1000` (即 1 秒)
|
|
63
|
+
* @returns 一个 `Promise`, 到指定时间后会变为 `fulfilled` 状态
|
|
64
|
+
* @example
|
|
65
|
+
* ```js
|
|
66
|
+
* sleep().then(() => {
|
|
67
|
+
* // do something 1s later
|
|
68
|
+
* })
|
|
69
|
+
*
|
|
70
|
+
* await sleep(2500) // do something 2.5s later
|
|
71
|
+
* ```
|
|
72
|
+
* @version 0.2.0
|
|
73
|
+
*/
|
|
74
|
+
declare function sleep(time?: number): Promise<unknown>;
|
|
75
|
+
|
|
76
|
+
type TryitResultType<Res, Err> = [undefined, Res] | [Err, undefined];
|
|
77
|
+
type TryitResult<Res, Err extends Error> = Res extends Promise<infer R> ? Promise<TryitResultType<R, Err>> : TryitResultType<Res, Err>;
|
|
78
|
+
/**
|
|
79
|
+
* 将一个函数处理为 `error-first` 的函数
|
|
80
|
+
* @param fn 需要处理的函数, 可以是异步函数
|
|
81
|
+
* @returns 处理过的函数, 调用后返回一个 `error-first` 的元组 `[error, result]`;\
|
|
82
|
+
* 如果原函数是异步函数, 则返回值会是 `Promise<[error, result]>`;\
|
|
83
|
+
* 如果运行正常则 `result` 是原函数的返回值, `error` 为 `undefined`;\
|
|
84
|
+
* 如果出现异常则 `result` 为 `undefined`, `error` 是原函数抛出的错误
|
|
85
|
+
* @example
|
|
86
|
+
* ```js
|
|
87
|
+
* // Sync Function
|
|
88
|
+
* const normalFn = () => { return 1 }
|
|
89
|
+
* const errorFn = () => { throw new Error('1') }
|
|
90
|
+
* tryit(normalFn)() // [undefined, 1]
|
|
91
|
+
* tryit(errorFn)() // [Error('1'), undefined]
|
|
92
|
+
* // Async Function
|
|
93
|
+
* const normalAsyncFn = () => { return Promise.resolve(1) }
|
|
94
|
+
* const errorAsyncFn = () => { return Promise.reject('1') }
|
|
95
|
+
* tryit(normalAsyncFn)() // Promise<[undefined, 1]>
|
|
96
|
+
* tryit(errorAsyncFn)() // Promise<[Error('1'), undefined]>
|
|
97
|
+
* ```
|
|
98
|
+
* @version 0.2.0
|
|
99
|
+
*/
|
|
100
|
+
declare function tryit<Args extends any[], Res, Err extends Error>(fn: (...args: Args) => Res): (...args: Args) => TryitResult<Res, Err>;
|
|
101
|
+
|
|
102
|
+
interface PromiseLikeConstructor {
|
|
103
|
+
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): PromiseLike<T>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 实现了 ES2024 引入 `Promise.withResolvers` 的 ponyfill
|
|
107
|
+
* @param PromiseLike 任何与 `Promise` 构造函数相同签名的构造函数
|
|
108
|
+
* @returns 返回一个对象, 其中 `promise` 是一个 `Promise` 实例, `resolve` 和 `reject` 是两个 `Promise` 中 `executor` 接收的方法
|
|
109
|
+
* @example
|
|
110
|
+
* ```js
|
|
111
|
+
* function readFileAsBase64(file: File) {
|
|
112
|
+
* const { promise, resolve, reject } = withResolvers<string>()
|
|
113
|
+
* const reader = new FileReader()
|
|
114
|
+
* reader.readAsDataURL(file)
|
|
115
|
+
* reader.onload = function () {
|
|
116
|
+
* resolve(reader.result as string)
|
|
117
|
+
* }
|
|
118
|
+
* reader.onerror = function () {
|
|
119
|
+
* reject()
|
|
120
|
+
* }
|
|
121
|
+
* return promise
|
|
122
|
+
* }
|
|
123
|
+
*
|
|
124
|
+
* const fileBase64 = await readFileAsBase64(someFile)
|
|
125
|
+
* ```
|
|
126
|
+
* @version 0.2.0
|
|
127
|
+
*/
|
|
128
|
+
declare function withResolvers<T>(): {
|
|
129
|
+
promise: Promise<T>;
|
|
130
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
131
|
+
reject: (reason?: any) => void;
|
|
132
|
+
};
|
|
133
|
+
declare function withResolvers<T>(PromiseLike: PromiseLikeConstructor): {
|
|
134
|
+
promise: PromiseLike<T>;
|
|
135
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
136
|
+
reject: (reason?: any) => void;
|
|
137
|
+
};
|
|
138
|
+
|
|
3
139
|
/**
|
|
4
140
|
* 类型守卫,判断给定的值是否为数组(使用内置的 `Array.isArray` 方法)
|
|
5
141
|
* @param value 要判断的值
|
|
@@ -63,11 +199,71 @@ declare function isBigInt(value: unknown): value is bigint;
|
|
|
63
199
|
declare function isBoolean(value: unknown): value is boolean;
|
|
64
200
|
|
|
65
201
|
/**
|
|
66
|
-
* 类型守卫,判断给定的值是否为`Buffer`(
|
|
202
|
+
* 类型守卫,判断给定的值是否为`Buffer`(使用内置的 `Buffer.isBuffer` 方法)
|
|
203
|
+
* - 非 Node.js 环境会使用当前环境的 `Buffer` 全局对象
|
|
67
204
|
* @param value 要判断的值
|
|
68
205
|
*/
|
|
69
206
|
declare const isBuffer: (obj: any) => obj is Buffer;
|
|
70
207
|
|
|
208
|
+
/**
|
|
209
|
+
* 类型守卫,判断给定的值是否为 `DataView` 类型
|
|
210
|
+
* @param value 要判断的值
|
|
211
|
+
* @example
|
|
212
|
+
* ```js
|
|
213
|
+
* isDataView(new DataView(new ArrayBuffer(8))) // true
|
|
214
|
+
* isDataView(new ArrayBuffer(8)) // false
|
|
215
|
+
* isDataView([1, 2, 3]) // false
|
|
216
|
+
* ```
|
|
217
|
+
* @version 0.2.0
|
|
218
|
+
*/
|
|
219
|
+
declare function isDataView(value: unknown): value is DataView;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* 类型守卫,判断给定的值是否为 `Date`
|
|
223
|
+
* @param value 要判断的值
|
|
224
|
+
* @example
|
|
225
|
+
* ```js
|
|
226
|
+
* isDate(new Date()) // true
|
|
227
|
+
* isDate(new Date(123456789)) // true
|
|
228
|
+
* isDate(Date.now()) // false
|
|
229
|
+
* isDate(Date) // false
|
|
230
|
+
* isDate({}) // false
|
|
231
|
+
* ```
|
|
232
|
+
* @version 0.2.0
|
|
233
|
+
*/
|
|
234
|
+
declare function isDate(value: unknown): value is Date;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* 类型守卫,判断给定的值是否为`File`
|
|
238
|
+
* - 非 Web 环境会使用当前环境的 `File` 全局对象
|
|
239
|
+
* - Node.js 18+ 才引入了此 API, Node.js 20+ 实现了完全支持
|
|
240
|
+
* @param value 要判断的值
|
|
241
|
+
* @example
|
|
242
|
+
* ```js
|
|
243
|
+
* isFile(new File([new ArrayBuffer(8)], 'fileName')) // true
|
|
244
|
+
* isFile(new ArrayBuffer(8)) // false
|
|
245
|
+
* isFile([1, 2, 3]) // false
|
|
246
|
+
* ```
|
|
247
|
+
* @version 0.2.0
|
|
248
|
+
*/
|
|
249
|
+
declare function isFile(value: unknown): value is File;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* 类型守卫,判断给定的值是否为`FormData`
|
|
253
|
+
* - 非 Web 环境会使用当前环境的 `FormData` 全局对象
|
|
254
|
+
* - Node.js 18+ 才引入了此 API
|
|
255
|
+
* @param value 要判断的值
|
|
256
|
+
* @example
|
|
257
|
+
* ```js
|
|
258
|
+
* isFormData(new FormData()) // true
|
|
259
|
+
* isFormData({}) // false
|
|
260
|
+
* isFormData([]) // false
|
|
261
|
+
* isFormData(null) // false
|
|
262
|
+
* ```
|
|
263
|
+
* @version 0.2.0
|
|
264
|
+
*/
|
|
265
|
+
declare function isFormData(value: unknown): value is FormData;
|
|
266
|
+
|
|
71
267
|
/**
|
|
72
268
|
* 类型守卫,判断给定的值是否为函数
|
|
73
269
|
* - 会将构造函数也视为函数
|
|
@@ -98,6 +294,23 @@ declare function isFunction(value: unknown): value is Function;
|
|
|
98
294
|
*/
|
|
99
295
|
declare function isInteger(value: unknown): value is number;
|
|
100
296
|
|
|
297
|
+
/**
|
|
298
|
+
* 类型守卫,判断给定的值是否可迭代 `Iterable`
|
|
299
|
+
* @param value 要判断的值
|
|
300
|
+
* @example
|
|
301
|
+
* ```js
|
|
302
|
+
* isIterable([]) // true
|
|
303
|
+
* isIterable("1") // true
|
|
304
|
+
* isIterable(new Map()) // true
|
|
305
|
+
* isIterable(new Set()) // true
|
|
306
|
+
* isIterable({}) // false
|
|
307
|
+
* isIterable(null) // false
|
|
308
|
+
* isIterable(1234) // false
|
|
309
|
+
* ```
|
|
310
|
+
* @version 0.2.0
|
|
311
|
+
*/
|
|
312
|
+
declare function isIterable(value: unknown): value is Iterable<unknown>;
|
|
313
|
+
|
|
101
314
|
/**
|
|
102
315
|
* 类型守卫,判断给定的值是否为`Map`
|
|
103
316
|
* @param value 要判断的值
|
|
@@ -226,6 +439,19 @@ declare function isPromise(value: unknown): value is Promise<any>;
|
|
|
226
439
|
*/
|
|
227
440
|
declare function isPromiseLike(value: unknown): value is Promise<any>;
|
|
228
441
|
|
|
442
|
+
/**
|
|
443
|
+
* 类型守卫,判断给定的值是否为正则表达式 `RegExp`
|
|
444
|
+
* @param value 要判断的值
|
|
445
|
+
* @example
|
|
446
|
+
* ```js
|
|
447
|
+
* isRegExp(/123/) // true
|
|
448
|
+
* isRegExp(new RegExp("123")) // true
|
|
449
|
+
* isRegExp("123") // false
|
|
450
|
+
* ```
|
|
451
|
+
* @version 0.2.0
|
|
452
|
+
*/
|
|
453
|
+
declare function isRegExp(value: unknown): value is RegExp;
|
|
454
|
+
|
|
229
455
|
/**
|
|
230
456
|
* 类型守卫,判断给定的值是否为`Set`
|
|
231
457
|
* @param value 要判断的值
|
|
@@ -263,6 +489,153 @@ declare function isString(value: unknown): value is string;
|
|
|
263
489
|
*/
|
|
264
490
|
declare function isSymbol(value: unknown): value is symbol;
|
|
265
491
|
|
|
492
|
+
type TypedArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
|
|
493
|
+
/**
|
|
494
|
+
* 类型守卫,判断给定的值是否为 `TypedArray` 类型
|
|
495
|
+
* @param value 要判断的值
|
|
496
|
+
* @example
|
|
497
|
+
* ```js
|
|
498
|
+
* isTypedArray(new Int8Array([1, 2, 3])) // true
|
|
499
|
+
* isTypedArray(new Uint8Array([1, 2, 3])) // true
|
|
500
|
+
* isTypedArray([1, 2, 3]) // false
|
|
501
|
+
* isTypedArray(new ArrayBuffer(8)) // false
|
|
502
|
+
* ```
|
|
503
|
+
*/
|
|
504
|
+
declare function isTypedArray(value: unknown): value is TypedArray;
|
|
505
|
+
/**
|
|
506
|
+
* 类型守卫,判断给定的值是否为 `Int8Array` 类型
|
|
507
|
+
* @param value 要判断的值
|
|
508
|
+
* @example
|
|
509
|
+
* ```js
|
|
510
|
+
* isInt8Array(new Int8Array([1, 2, 3])) // true
|
|
511
|
+
* isInt8Array(new Uint8Array([1, 2, 3])) // false
|
|
512
|
+
* isInt8Array([1, 2, 3]) // false
|
|
513
|
+
* isInt8Array(new ArrayBuffer(8)) // false
|
|
514
|
+
* ```
|
|
515
|
+
*/
|
|
516
|
+
declare function isInt8Array(value: unknown): value is Int8Array;
|
|
517
|
+
/**
|
|
518
|
+
* 类型守卫,判断给定的值是否为 `Int16Array` 类型
|
|
519
|
+
* @param value 要判断的值
|
|
520
|
+
* @example
|
|
521
|
+
* ```js
|
|
522
|
+
* isInt16Array(new Int16Array([1, 2, 3])) // true
|
|
523
|
+
* isInt16Array(new Uint8Array([1, 2, 3])) // false
|
|
524
|
+
* isInt16Array([1, 2, 3]) // false
|
|
525
|
+
* isInt16Array(new ArrayBuffer(8)) // false
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
528
|
+
declare function isInt16Array(value: unknown): value is Int16Array;
|
|
529
|
+
/**
|
|
530
|
+
* 类型守卫,判断给定的值是否为 `Int32Array` 类型
|
|
531
|
+
* @param value 要判断的值
|
|
532
|
+
* @example
|
|
533
|
+
* ```js
|
|
534
|
+
* isInt32Array(new Int32Array([1, 2, 3])) // true
|
|
535
|
+
* isInt32Array(new Uint8Array([1, 2, 3])) // false
|
|
536
|
+
* isInt32Array([1, 2, 3]) // false
|
|
537
|
+
* isInt32Array(new ArrayBuffer(8)) // false
|
|
538
|
+
* ```
|
|
539
|
+
*/
|
|
540
|
+
declare function isInt32Array(value: unknown): value is Int32Array;
|
|
541
|
+
/**
|
|
542
|
+
* 类型守卫,判断给定的值是否为 `Uint8Array` 类型
|
|
543
|
+
* @param value 要判断的值
|
|
544
|
+
* @example
|
|
545
|
+
* ```js
|
|
546
|
+
* isUint8Array(new Uint8Array([1, 2, 3])) // true
|
|
547
|
+
* isUint8Array(new Int8Array([1, 2, 3])) // false
|
|
548
|
+
* isUint8Array([1, 2, 3]) // false
|
|
549
|
+
* isUint8Array(new ArrayBuffer(8)) // false
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
declare function isUint8Array(value: unknown): value is Uint8Array;
|
|
553
|
+
/**
|
|
554
|
+
* 类型守卫,判断给定的值是否为 `Uint8ClampedArray` 类型
|
|
555
|
+
* @param value 要判断的值
|
|
556
|
+
* @example
|
|
557
|
+
* ```js
|
|
558
|
+
* isUint8ClampedArray(new Uint8ClampedArray([1, 2, 3])) // true
|
|
559
|
+
* isUint8ClampedArray(new Uint8Array([1, 2, 3])) // false
|
|
560
|
+
* isUint8ClampedArray([1, 2, 3]) // false
|
|
561
|
+
* isUint8ClampedArray(new ArrayBuffer(8)) // false
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
declare function isUint8ClampedArray(value: unknown): value is Uint8ClampedArray;
|
|
565
|
+
/**
|
|
566
|
+
* 类型守卫,判断给定的值是否为 `Uint16Array` 类型
|
|
567
|
+
* @param value 要判断的值
|
|
568
|
+
* @example
|
|
569
|
+
* ```js
|
|
570
|
+
* isUint16Array(new Uint16Array([1, 2, 3])) // true
|
|
571
|
+
* isUint16Array(new Uint8Array([1, 2, 3])) // false
|
|
572
|
+
* isUint16Array([1, 2, 3]) // false
|
|
573
|
+
* isUint16Array(new ArrayBuffer(8)) // false
|
|
574
|
+
* ```
|
|
575
|
+
*/
|
|
576
|
+
declare function isUint16Array(value: unknown): value is Uint16Array;
|
|
577
|
+
/**
|
|
578
|
+
* 类型守卫,判断给定的值是否为 `Uint32Array` 类型
|
|
579
|
+
* @param value 要判断的值
|
|
580
|
+
* @example
|
|
581
|
+
* ```js
|
|
582
|
+
* isUint32Array(new Uint32Array([1, 2, 3])) // true
|
|
583
|
+
* isUint32Array(new Uint8Array([1, 2, 3])) // false
|
|
584
|
+
* isUint32Array([1, 2, 3]) // false
|
|
585
|
+
* isUint32Array(new ArrayBuffer(8)) // false
|
|
586
|
+
* ```
|
|
587
|
+
*/
|
|
588
|
+
declare function isUint32Array(value: unknown): value is Uint32Array;
|
|
589
|
+
/**
|
|
590
|
+
* 类型守卫,判断给定的值是否为 `Float32Array` 类型
|
|
591
|
+
* @param value 要判断的值
|
|
592
|
+
* @example
|
|
593
|
+
* ```js
|
|
594
|
+
* isFloat32Array(new Float32Array([1, 2, 3])) // true
|
|
595
|
+
* isFloat32Array(new Uint8Array([1, 2, 3])) // false
|
|
596
|
+
* isFloat32Array([1, 2, 3]) // false
|
|
597
|
+
* isFloat32Array(new ArrayBuffer(8)) // false
|
|
598
|
+
* ```
|
|
599
|
+
*/
|
|
600
|
+
declare function isFloat32Array(value: unknown): value is Float32Array;
|
|
601
|
+
/**
|
|
602
|
+
* 类型守卫,判断给定的值是否为 `Float64Array` 类型
|
|
603
|
+
* @param value 要判断的值
|
|
604
|
+
* @example
|
|
605
|
+
* ```js
|
|
606
|
+
* isFloat64Array(new Float64Array([1, 2, 3])) // true
|
|
607
|
+
* isFloat64Array(new Uint8Array([1, 2, 3])) // false
|
|
608
|
+
* isFloat64Array([1, 2, 3]) // false
|
|
609
|
+
* isFloat64Array(new ArrayBuffer(8)) // false
|
|
610
|
+
* ```
|
|
611
|
+
*/
|
|
612
|
+
declare function isFloat64Array(value: unknown): value is Float64Array;
|
|
613
|
+
/**
|
|
614
|
+
* 类型守卫,判断给定的值是否为 `BigInt64Array` 类型
|
|
615
|
+
* @param value 要判断的值
|
|
616
|
+
* @example
|
|
617
|
+
* ```js
|
|
618
|
+
* isBigInt64Array(new BigInt64Array([1n, 2n, 3n])) // true
|
|
619
|
+
* isBigInt64Array(new Uint8Array([1, 2, 3])) // false
|
|
620
|
+
* isBigInt64Array([1, 2, 3]) // false
|
|
621
|
+
* isBigInt64Array(new ArrayBuffer(8)) // false
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
declare function isBigInt64Array(value: unknown): value is BigInt64Array;
|
|
625
|
+
/**
|
|
626
|
+
* 类型守卫,判断给定的值是否为 `BigUint64Array` 类型
|
|
627
|
+
* @param value 要判断的值
|
|
628
|
+
* @example
|
|
629
|
+
* ```js
|
|
630
|
+
* isBigUint64Array(new BigUint64Array([1n, 2n, 3n])) // true
|
|
631
|
+
* isBigUint64Array(new Uint8Array([1, 2, 3])) // false
|
|
632
|
+
* isBigUint64Array([1, 2, 3]) // false
|
|
633
|
+
* isBigUint64Array(new ArrayBuffer(8)) // false
|
|
634
|
+
* ```
|
|
635
|
+
* @version 0.2.0
|
|
636
|
+
*/
|
|
637
|
+
declare function isBigUint64Array(value: unknown): value is BigUint64Array;
|
|
638
|
+
|
|
266
639
|
/**
|
|
267
640
|
* 类型守卫,判断给定的值是否为包装对象(可能是数字、字符串、`Symbol`、布尔、`BigInt`)
|
|
268
641
|
* @param value 要判断的值
|
|
@@ -521,16 +894,114 @@ declare const uuidNil = "00000000-0000-0000-0000-000000000000";
|
|
|
521
894
|
declare function uuidV4(): string;
|
|
522
895
|
|
|
523
896
|
/**
|
|
524
|
-
*
|
|
525
|
-
* @param
|
|
897
|
+
* 将输入的字符串处理成小驼峰格式
|
|
898
|
+
* @param str 想要转换的字符串
|
|
899
|
+
* @param options.keepLetterCase 是否保留原来的大小写, 默认不保留
|
|
900
|
+
* @param options.keepNumber 是否保留数字, 默认保留
|
|
901
|
+
* @returns 转换为小驼峰格式的字符串
|
|
902
|
+
* @example
|
|
903
|
+
* ```js
|
|
904
|
+
* // 默认情况 不保留大小写 保留数字
|
|
905
|
+
* camelCase("get-Test-UUID-1234") // "getTestUuid1234"
|
|
906
|
+
* // 保留大小写 保留数字
|
|
907
|
+
* camelCase("get-Test-UUID-1234", { keepLetterCase: true }) // "getTestUUID1234"
|
|
908
|
+
* // 保留大小写 不保留数字
|
|
909
|
+
* camelCase("get-Test-UUID-1234", { keepLetterCase: true, keepNumber: false }) // "getTestUUID"
|
|
910
|
+
* ```
|
|
911
|
+
* @version 0.2.0
|
|
526
912
|
*/
|
|
527
|
-
declare function
|
|
913
|
+
declare function camelCase(str: string, options?: {
|
|
914
|
+
keepLetterCase?: boolean;
|
|
915
|
+
keepNumber?: boolean;
|
|
916
|
+
}): string;
|
|
528
917
|
|
|
529
918
|
/**
|
|
530
|
-
*
|
|
531
|
-
* @
|
|
919
|
+
* 将输入的字符串处理成串行格式(短横线分割)
|
|
920
|
+
* @param str 想要转换的字符串
|
|
921
|
+
* @param options.keepLetterCase 是否保留原来的大小写, 默认不保留
|
|
922
|
+
* @param options.keepNumber 是否保留数字, 默认保留
|
|
923
|
+
* @returns 转换为串行格式的字符串
|
|
924
|
+
* @example
|
|
925
|
+
* ```js
|
|
926
|
+
* // 默认情况 不保留大小写 保留数字
|
|
927
|
+
* kebabCase("getTestUuid1234") // "get-test-uuid-1234"
|
|
928
|
+
* // 保留大小写 保留数字
|
|
929
|
+
* kebabCase("getTestUuid1234", { keepLetterCase: true }) // "get-Test-UUID-1234"
|
|
930
|
+
* // 保留大小写 不保留数字
|
|
931
|
+
* kebabCase("getTestUuid1234", { keepLetterCase: true, keepNumber: false }) // "get-Test-UUID"
|
|
932
|
+
* ```
|
|
933
|
+
* @version 0.2.0
|
|
532
934
|
*/
|
|
533
|
-
declare function
|
|
935
|
+
declare function kebabCase(str: string, options?: {
|
|
936
|
+
keepLetterCase?: boolean;
|
|
937
|
+
keepNumber?: boolean;
|
|
938
|
+
}): string;
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* 将输入的字符串处理成大驼峰格式
|
|
942
|
+
* @param str 想要转换的字符串
|
|
943
|
+
* @param options.keepLetterCase 是否保留原来的大小写, 默认不保留
|
|
944
|
+
* @param options.keepNumber 是否保留数字, 默认保留
|
|
945
|
+
* @returns 转换为大驼峰格式的字符串
|
|
946
|
+
* @example
|
|
947
|
+
* ```js
|
|
948
|
+
* // 默认情况 不保留大小写 保留数字
|
|
949
|
+
* pascalCase("get-Test-UUID-1234") // "GetTestUuid1234"
|
|
950
|
+
* // 保留大小写 保留数字
|
|
951
|
+
* pascalCase("get-Test-UUID-1234", { keepLetterCase: true }) // "GetTestUUID1234"
|
|
952
|
+
* // 保留大小写 不保留数字
|
|
953
|
+
* pascalCase("get-Test-UUID-1234", { keepLetterCase: true, keepNumber: false }) // "GetTestUUID"
|
|
954
|
+
* ```
|
|
955
|
+
* @version 0.2.0
|
|
956
|
+
*/
|
|
957
|
+
declare function pascalCase(str: string, options?: {
|
|
958
|
+
keepLetterCase?: boolean;
|
|
959
|
+
keepNumber?: boolean;
|
|
960
|
+
}): string;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* 将输入的字符串处理成蛇行格式(下划线分割)
|
|
964
|
+
* @param str 想要转换的字符串
|
|
965
|
+
* @param options.keepLetterCase 是否保留原来的大小写
|
|
966
|
+
* @param options.keepNumber 是否保留数字, 默认保留
|
|
967
|
+
* @returns 转换为蛇行格式的字符串
|
|
968
|
+
* @example
|
|
969
|
+
* ```js
|
|
970
|
+
* // 默认情况 不保留大小写 保留数字
|
|
971
|
+
* snakeCase("getTestUuid1234") // "get_test_uuid_1234"
|
|
972
|
+
* // 保留大小写 保留数字
|
|
973
|
+
* snakeCase("getTestUuid1234", { keepLetterCase: true }) // "get_Test_UUID_1234"
|
|
974
|
+
* // 保留大小写 不保留数字
|
|
975
|
+
* snakeCase("getTestUuid1234", { keepLetterCase: true, keepNumber: false }) // "get_Test_UUID"
|
|
976
|
+
* ```
|
|
977
|
+
* @version 0.2.0
|
|
978
|
+
*/
|
|
979
|
+
declare function snakeCase(str: string, options?: {
|
|
980
|
+
keepLetterCase?: boolean;
|
|
981
|
+
keepNumber?: boolean;
|
|
982
|
+
}): string;
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* 将输入的字符串处理成标题格式(类似大驼峰, 不过有空格分割)
|
|
986
|
+
* @param str 想要转换的字符串
|
|
987
|
+
* @param options.keepLetterCase 是否保留原来的大小写
|
|
988
|
+
* @param options.keepNumber 是否保留数字, 默认保留
|
|
989
|
+
* @returns 转换为标题格式的字符串
|
|
990
|
+
* @example
|
|
991
|
+
* ```js
|
|
992
|
+
* // 默认情况 不保留大小写 保留数字
|
|
993
|
+
* titleCase("getTestUuid1234") // "Get Test Uuid 1234"
|
|
994
|
+
* // 保留大小写 保留数字
|
|
995
|
+
* titleCase("getTestUuid1234", { keepLetterCase: true }) // "Get Test UUID 1234"
|
|
996
|
+
* // 保留大小写 不保留数字
|
|
997
|
+
* titleCase("getTestUuid1234", { keepLetterCase: true, keepNumber: false }) // "Get Test UUID"
|
|
998
|
+
* ```
|
|
999
|
+
* @version 0.2.0
|
|
1000
|
+
*/
|
|
1001
|
+
declare function titleCase(str: string, options?: {
|
|
1002
|
+
keepLetterCase?: boolean;
|
|
1003
|
+
keepNumber?: boolean;
|
|
1004
|
+
}): string;
|
|
534
1005
|
|
|
535
1006
|
type VarCase = {
|
|
536
1007
|
code: string;
|
|
@@ -559,20 +1030,22 @@ type VarCase = {
|
|
|
559
1030
|
declare function caseConvert(str: string, joiner?: string, handler?: (token: VarCase, index: number) => string): string;
|
|
560
1031
|
/**
|
|
561
1032
|
* 将输入的字符串处理成小驼峰格式
|
|
1033
|
+
* @deprecated 推荐使用 `camelCase` 替代
|
|
562
1034
|
* @param str 想要转换的字符串
|
|
563
1035
|
* @param keepLetterCase 是否保留原来的大小写, 默认不保留
|
|
564
1036
|
* @param keepNumber 是否保留数字, 默认保留
|
|
565
1037
|
* @returns 转换为小驼峰格式的字符串
|
|
566
1038
|
* @example
|
|
567
1039
|
* ```js
|
|
568
|
-
* caseCamel("get-Test-UUID-1234") // "getTestUuid1234"
|
|
569
|
-
* caseCamel("get-Test-UUID-1234", true) // "getTestUUID1234"
|
|
570
|
-
* caseCamel("get-Test-UUID-1234", true, false) // "getTestUUID"
|
|
1040
|
+
* caseCamel("get-Test-UUID-1234") // "getTestUuid1234"
|
|
1041
|
+
* caseCamel("get-Test-UUID-1234", true) // "getTestUUID1234"
|
|
1042
|
+
* caseCamel("get-Test-UUID-1234", true, false) // "getTestUUID"
|
|
571
1043
|
* ```
|
|
572
1044
|
*/
|
|
573
1045
|
declare function caseCamel(str: string, keepLetterCase?: boolean, keepNumber?: boolean): string;
|
|
574
1046
|
/**
|
|
575
1047
|
* 将输入的字符串处理成大驼峰格式
|
|
1048
|
+
* @deprecated 推荐使用 `pascalCase` 替代
|
|
576
1049
|
* @param str 想要转换的字符串
|
|
577
1050
|
* @param keepLetterCase 是否保留原来的大小写
|
|
578
1051
|
* @param keepNumber 是否保留数字, 默认保留
|
|
@@ -587,6 +1060,7 @@ declare function caseCamel(str: string, keepLetterCase?: boolean, keepNumber?: b
|
|
|
587
1060
|
declare function casePascal(str: string, keepLetterCase?: boolean, keepNumber?: boolean): string;
|
|
588
1061
|
/**
|
|
589
1062
|
* 将输入的字符串处理成串行格式
|
|
1063
|
+
* @deprecated 推荐使用 `kebabCase` 替代
|
|
590
1064
|
* @param str 想要转换的字符串
|
|
591
1065
|
* @param keepLetterCase 是否保留原来的大小写
|
|
592
1066
|
* @param keepNumber 是否保留数字, 默认保留
|
|
@@ -601,6 +1075,7 @@ declare function casePascal(str: string, keepLetterCase?: boolean, keepNumber?:
|
|
|
601
1075
|
declare function caseKebab(str: string, keepLetterCase?: boolean, keepNumber?: boolean): string;
|
|
602
1076
|
/**
|
|
603
1077
|
* 将输入的字符串处理成蛇行格式
|
|
1078
|
+
* @deprecated 推荐使用 `snakeCase` 替代
|
|
604
1079
|
* @param str 想要转换的字符串
|
|
605
1080
|
* @param keepLetterCase 是否保留原来的大小写
|
|
606
1081
|
* @param keepNumber 是否保留数字, 默认保留
|
|
@@ -614,6 +1089,32 @@ declare function caseKebab(str: string, keepLetterCase?: boolean, keepNumber?: b
|
|
|
614
1089
|
*/
|
|
615
1090
|
declare function caseSnake(str: string, keepLetterCase?: boolean, keepNumber?: boolean): string;
|
|
616
1091
|
|
|
1092
|
+
/**
|
|
1093
|
+
* 分割单词, 适用于分割、转换变量名的场景
|
|
1094
|
+
* - 任何非英文字母、数字的字符均会视为分割符
|
|
1095
|
+
* @param str 需要分割的字符串
|
|
1096
|
+
* @returns 分割后的字符串
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```js
|
|
1099
|
+
* splitWords("getTestUUID1234") // ["get", "Test", "UUID", "1234"]
|
|
1100
|
+
* splitWords("user_nick_name") // ["user", "nick", "name"]
|
|
1101
|
+
* splitWords("A文字B🎈C=-=Test") // ["A", "B", "C", "Test"]
|
|
1102
|
+
* ```
|
|
1103
|
+
*/
|
|
1104
|
+
declare function splitWords(str: string): string[];
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* 调用`Object.prototype.toString`获取对象类型名称
|
|
1108
|
+
* @param value 要判断的类型
|
|
1109
|
+
*/
|
|
1110
|
+
declare function getTag(value: unknown): string;
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* 获取全局对象,浏览器环境返回 `self` 或 `window`, Node.js 环境返回 `global`
|
|
1114
|
+
* @returns 全局对象
|
|
1115
|
+
*/
|
|
1116
|
+
declare function getGlobalThis(): typeof globalThis;
|
|
1117
|
+
|
|
617
1118
|
// compose
|
|
618
1119
|
type ComposeFuncList1<CompArgs extends any[], CompResult> = [(...args: CompArgs) => CompResult]
|
|
619
1120
|
type ComposeFuncList2<CompArgs extends any[], CompResult, Mid1 = any> = [
|
|
@@ -770,16 +1271,62 @@ declare function _curryMore<Arg1, Arg2, Res>(fn: (arg1: Arg1, arg2: Arg2) => Res
|
|
|
770
1271
|
declare function _curryMore<Arg1, Arg2, Arg3, Res>(fn: (arg1: Arg1, arg2: Arg2, arg3: Arg3) => Res): F.Curry<(arg1: Arg1, arg2: Arg2, arg3: Arg3) => Res>;
|
|
771
1272
|
declare function _curryMore<Args extends Array<any>, Res>(fn: (...args: Args) => Res): F.Curry<(...args: Args) => Res>;
|
|
772
1273
|
|
|
1274
|
+
interface CustomCloner<T = any> {
|
|
1275
|
+
cloner(val: T, map: Map<any, any>): T;
|
|
1276
|
+
judger(val: any): boolean;
|
|
1277
|
+
}
|
|
1278
|
+
/** 深拷贝的配置项 */
|
|
1279
|
+
type CloneOptions = {
|
|
1280
|
+
/** 拷贝 Symbol 键 默认为 true */
|
|
1281
|
+
cloneSymbol: boolean;
|
|
1282
|
+
/** 拷贝对象原型 默认为 false */
|
|
1283
|
+
clonePrototype: boolean;
|
|
1284
|
+
/** 拷贝属性的 Descriptor 默认为 false */
|
|
1285
|
+
cloneDescriptor: boolean;
|
|
1286
|
+
/** 自定义拷贝逻辑 默认为空 */
|
|
1287
|
+
customCloner: CustomCloner[];
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* 标准深拷贝
|
|
1292
|
+
* - 功能完善的深拷贝
|
|
1293
|
+
* - 如果不需要支持一些冷门的数据类型, 可以使用 `fastClone` 代替
|
|
1294
|
+
* - 可以使用 `customCloner` 实现自定义拷贝特殊数据的逻辑(如拷贝 Web 环境下的 `HTMLElement`)
|
|
1295
|
+
* - 支持处理包括循环引用、数组、正则、`DataView`、`ArrayBuffer` 等复杂数据类型
|
|
1296
|
+
* - **暂不支持 `File` 类型**
|
|
1297
|
+
* - 可以配置是否拷贝对象的原型、属性 descriptor、以 `Symbol` 为键的属性
|
|
1298
|
+
* - 无法拷贝的内容将视为原生数据类型, 直接复制(如函数、`Promise`、`WeakMap`、`WeakSet`)
|
|
1299
|
+
* - 层级过深(500 层以上)时可能导致栈溢出
|
|
1300
|
+
* @param obj 需要深拷贝的数据
|
|
1301
|
+
* @param options 配置项, 可选, 除非有特殊需求否则不传
|
|
1302
|
+
* - `cloneSymbol`: 是否拷贝 `Symbol` 类型的键, 默认为 `true`
|
|
1303
|
+
* - `clonePrototype`: 是否拷贝对象原型, 默认为 `false`
|
|
1304
|
+
* - `cloneDescriptor`: 是否拷贝属性 Descriptor, 默认为 `false`
|
|
1305
|
+
* - `customCloner`: 自定义拷贝函数, 默认为空数组, 即不支持自定义拷贝
|
|
1306
|
+
* @param map 缓存对象, 用于处理循环引用, 建议不传
|
|
1307
|
+
* @example
|
|
1308
|
+
* ```js
|
|
1309
|
+
* const obj = { map: new Map() }
|
|
1310
|
+
* obj.map.set(obj, 'val')
|
|
1311
|
+
* // 用 deepClone 复制带有 Map 和循环引用的对象
|
|
1312
|
+
* const clone = deepClone(obj)
|
|
1313
|
+
* clone === obj // false
|
|
1314
|
+
* clone.map === obj.map // false
|
|
1315
|
+
* clone.map.get(clone) === 'val' // true
|
|
1316
|
+
* ```
|
|
1317
|
+
* @version 0.2.0
|
|
1318
|
+
*/
|
|
1319
|
+
declare function deepClone<T>(obj: T, options?: Partial<CloneOptions>, map?: Map<any, any>): T;
|
|
1320
|
+
|
|
773
1321
|
/**
|
|
774
1322
|
* 快速深拷贝
|
|
775
|
-
* -
|
|
776
|
-
* - 支持处理的情况:循环引用、数组、`Date`、正则、`Set`、`Map`
|
|
1323
|
+
* - 相对 `deepClone` 而言运行更快, 功能较为齐全
|
|
1324
|
+
* - 支持处理的情况:循环引用、数组、`Date`、正则、`Set`、`Map`、`FormData`
|
|
777
1325
|
* - 对象上以 `Symbol` 为键的属性无法拷贝
|
|
778
|
-
* -
|
|
779
|
-
* - 如函数、`Promise`、`WeakMap`、`WeakSet`
|
|
1326
|
+
* - 无法拷贝的内容将视为原生数据类型, 直接复制(如函数、`Promise`、`WeakMap`、`WeakSet`)
|
|
780
1327
|
* - 层级过深(500 层以上)时可能导致栈溢出
|
|
781
1328
|
* @param obj 需要深拷贝的数据
|
|
782
|
-
* @param map
|
|
1329
|
+
* @param map 缓存对象, 用于处理循环引用, 建议不传
|
|
783
1330
|
* @example
|
|
784
1331
|
* ```js
|
|
785
1332
|
* const obj = { map: new Map() }
|
|
@@ -800,9 +1347,10 @@ declare function fastClone<T>(obj: T, map?: Map<any, any>): T;
|
|
|
800
1347
|
* 3. 若值为 函数 返回 `false`
|
|
801
1348
|
* 4. 若值为 类数组对象: `length` 为 `0` 返回 `true` 否则返回 `false`
|
|
802
1349
|
* 5. 若值为 `Buffer` 或 `ArrayBuffer`: `byteLength` 为 `0` 返回 `true` 否则返回 `false`
|
|
803
|
-
* 6. 若值为 `
|
|
804
|
-
* 7.
|
|
805
|
-
* 8.
|
|
1350
|
+
* 6. 若值为 `Date`: 无效值 返回 `true` 否则返回 `false`
|
|
1351
|
+
* 7. 若值为 `Set` 或 `Map`: `size` 为 `0` 返回 `true` 否则返回 `false`
|
|
1352
|
+
* 8. 若值不为 原始类型: 根据 `Object.getOwnPropertyNames` 判断是否存在自身键, 若没有返回 `true` 否则返回 `false`
|
|
1353
|
+
* 9. 返回 `false`
|
|
806
1354
|
* @param value 要判断的值
|
|
807
1355
|
* @example
|
|
808
1356
|
* ```js
|
|
@@ -821,6 +1369,22 @@ declare function fastClone<T>(obj: T, map?: Map<any, any>): T;
|
|
|
821
1369
|
*/
|
|
822
1370
|
declare function isEmpty(value: unknown): boolean;
|
|
823
1371
|
|
|
1372
|
+
/**
|
|
1373
|
+
* 将一个函数记忆化, 多次调用如果参数相同, 则直接返回缓存的结果, 而不会反复执行函数
|
|
1374
|
+
* - 每次运行时会将当前参数处理为 `key`, 相同 `key` 的函数调用将返回相同的结果
|
|
1375
|
+
* @param fn 要缓存的函数
|
|
1376
|
+
* @param options 缓存选项
|
|
1377
|
+
* - `getKey` 自定义 key 的生成规则, 默认使用内部方法生成 key
|
|
1378
|
+
* - `ttl` 缓存的过期时间, 单位毫秒, 为 0 表示不过期, 默认不过期
|
|
1379
|
+
* - `count` 缓存最大使用次数, 为 0 表示不限次数, 默认不限次数
|
|
1380
|
+
* @returns
|
|
1381
|
+
*/
|
|
1382
|
+
declare function memo<TArgs extends any[], TRes>(fn: (...args: TArgs) => TRes, options?: {
|
|
1383
|
+
getKey?: (...args: TArgs) => string | number;
|
|
1384
|
+
ttl?: number;
|
|
1385
|
+
count?: number;
|
|
1386
|
+
}): (this: any, ...args: TArgs) => TRes;
|
|
1387
|
+
|
|
824
1388
|
/**
|
|
825
1389
|
* 不做任何操作,返回 `void` ,一般用于函数式编程
|
|
826
1390
|
* @example
|
|
@@ -988,18 +1552,4 @@ declare function pipe<PipeArgs extends any[], PipeResult, Mid1, Mid2, Mid3, Mid4
|
|
|
988
1552
|
declare function pipe<PipeArgs extends any[], PipeResult, Mid1, Mid2, Mid3, Mid4, Mid5, Mid6, Mid7>(...pipeFunc: PipeFuncList8<PipeArgs, PipeResult, Mid1, Mid2, Mid3, Mid4, Mid5, Mid6, Mid7>): (...args: PipeArgs) => PipeResult;
|
|
989
1553
|
declare function pipe<PipeArgs extends any[], PipeResult, Mid1, Mid2, Mid3, Mid4, Mid5, Mid6, Mid7>(...pipeFunc: PipeFuncListMore<PipeArgs, PipeResult, Mid1, Mid2, Mid3, Mid4, Mid5, Mid6, Mid7>): (...args: PipeArgs) => PipeResult;
|
|
990
1554
|
|
|
991
|
-
|
|
992
|
-
* 分割单词, 适用于分割、转换变量名的场景
|
|
993
|
-
* - 任何非英文字母、数字的字符均会视为分割符
|
|
994
|
-
* @param str 需要分割的字符串
|
|
995
|
-
* @returns 分割后的字符串
|
|
996
|
-
* @example
|
|
997
|
-
* ```js
|
|
998
|
-
* splitWords("getTestUUID1234") // ["get", "Test", "UUID", "1234"]
|
|
999
|
-
* splitWords("user_nick_name") // ["user", "nick", "name"]
|
|
1000
|
-
* splitWords("A文字B🎈C=-=Test") // ["A", "B", "C", "Test"]
|
|
1001
|
-
* ```
|
|
1002
|
-
*/
|
|
1003
|
-
declare function splitWords(str: string): string[];
|
|
1004
|
-
|
|
1005
|
-
export { _, acceptableFileName, acceptableFileType, caseCamel, caseConvert, caseKebab, casePascal, caseSnake, compose, _curryMore as curry, fastClone, getAcceptableExtByMIME, getAcceptableMIMEByExt, getGlobalThis, getTag, isArray, isArrayBuffer, isArrayLike, isBigInt, isBoolean, isBuffer, isEmpty, isFunction, isInteger, isMap, isNil, isNull, isNumber, isObject, isPlaceholder, isPrimitive, isPromise, isPromiseLike, isSet, isString, isSymbol, isUndefined, isWeakMap, isWeakSet, isWrapperBigInt, isWrapperBoolean, isWrapperNumber, isWrapperObject, isWrapperString, isWrapperSymbol, noop, not, pass, passWith, pipe, randomBase32String, randomChoice, randomHexString, randomInt, randomIntFloor, randomString, shuffle, splitWords, ulid, uuidNil, uuidV4 };
|
|
1555
|
+
export { type CloneOptions, type CustomCloner, type RangeOptions, type TypedArray, _, acceptableFileName, acceptableFileType, camelCase, caseCamel, caseConvert, caseKebab, casePascal, caseSnake, compose, _curryMore as curry, deepClone, fastClone, getAcceptableExtByMIME, getAcceptableMIMEByExt, getGlobalThis, getTag, isArray, isArrayBuffer, isArrayLike, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isBuffer, isDataView, isDate, isEmpty, isFile, isFloat32Array, isFloat64Array, isFormData, isFunction, isInt16Array, isInt32Array, isInt8Array, isInteger, isIterable, isMap, isNil, isNull, isNumber, isObject, isPlaceholder, isPrimitive, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isWeakMap, isWeakSet, isWrapperBigInt, isWrapperBoolean, isWrapperNumber, isWrapperObject, isWrapperString, isWrapperSymbol, kebabCase, memo, noop, not, pascalCase, pass, passWith, pipe, randomBase32String, randomChoice, randomHexString, randomInt, randomIntFloor, randomString, range, shuffle, sleep, snakeCase, splitWords, titleCase, tryit, ulid, uuidNil, uuidV4, withResolvers };
|