deverything 3.3.1 → 4.1.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 +6 -4
- package/dist/index.d.mts +896 -0
- package/dist/index.d.ts +104 -87
- package/dist/index.global.js +2 -197
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +2 -192
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -14
package/dist/index.d.ts
CHANGED
|
@@ -141,17 +141,21 @@ type Serialized<T> = T extends Date ? string : T extends Array<infer R> ? Array<
|
|
|
141
141
|
} : T;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
145
|
-
* @
|
|
146
|
-
*
|
|
144
|
+
* Buckets dates into groups based on a date series
|
|
145
|
+
* @deprecated Use `groupByDateBucket` instead. This function will be removed in the next major version.
|
|
146
|
+
* @param dateSeries Array of dates that define the buckets, must be sorted in ascending order
|
|
147
|
+
* @param dates Array of dates to be bucketed, must be sorted in ascending order
|
|
148
|
+
* @param unit The time unit to use for bucketing ('day', 'hour', 'minute', 'second')
|
|
149
|
+
* @returns Record mapping each bucket date to an array of dates that fall within that bucket
|
|
147
150
|
*/
|
|
148
|
-
declare const
|
|
151
|
+
declare const bucketSortedDates: (dateSeries: ISODate[], dates: ISODate[], unit: "day" | "hour" | "minute" | "second") => Record<ISODate, ISODate[]>;
|
|
149
152
|
|
|
150
153
|
/**
|
|
151
154
|
*
|
|
152
|
-
* @
|
|
155
|
+
* @description Generate a series of dates between the start and end dates
|
|
156
|
+
* NOTE: it does NOT include the end date
|
|
153
157
|
*/
|
|
154
|
-
declare const
|
|
158
|
+
declare const getDateRangeSeries: (dateRange: DateRange, unit: "day" | "hour" | "minute" | "second" | "calendarMonth") => ISODate[];
|
|
155
159
|
|
|
156
160
|
/**
|
|
157
161
|
* @description Returns the smallest and biggest dates from an array of dates in DateRange format
|
|
@@ -159,7 +163,24 @@ declare const getDateSeries: (startDate: Date, endDate: Date, unit: "days" | "ho
|
|
|
159
163
|
* @returns DateRange object with startDate (smallest) and endDate (biggest)
|
|
160
164
|
* @throws Error if the array is empty or contains invalid dates
|
|
161
165
|
*/
|
|
162
|
-
declare const getDateSeriesRange: (dateSeries: DateSeries
|
|
166
|
+
declare const getDateSeriesRange: (dateSeries: DateSeries) => DateRange;
|
|
167
|
+
|
|
168
|
+
type PropertyAccessor<T> = keyof T | ((item: T) => any);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Groups items into date buckets based on their dates and specified time intervals
|
|
172
|
+
* @param dateBuckets Array of ISO date strings that define the bucket boundaries, must be sorted in ascending order
|
|
173
|
+
* @param items Array of items to be grouped into buckets, should be sorted in ascending order by the date property for optimal performance
|
|
174
|
+
* @param unit The time unit to use for bucket intervals ('day', 'hour', 'minute', 'second')
|
|
175
|
+
* @param accessor Optional property accessor for extracting dates from items. If not provided, assumes items are ISO date strings
|
|
176
|
+
* @returns Record where keys are ISO date strings from dateBuckets and values are arrays of items that fall within each bucket's time range
|
|
177
|
+
*/
|
|
178
|
+
declare function groupByDateBucket<T>({ dateBuckets, items, unit, accessor, }: {
|
|
179
|
+
dateBuckets: ISODate[];
|
|
180
|
+
items: T[];
|
|
181
|
+
unit: "day" | "hour" | "minute" | "second";
|
|
182
|
+
accessor?: PropertyAccessor<T>;
|
|
183
|
+
}): Record<ISODate, T[]>;
|
|
163
184
|
|
|
164
185
|
declare const isOver18: (birthDate: DateLike) => boolean;
|
|
165
186
|
|
|
@@ -203,8 +224,8 @@ declare const formatCookies: (object: PlainObject) => string;
|
|
|
203
224
|
/**
|
|
204
225
|
*
|
|
205
226
|
* @example formatIndexProgress(-1, 10) => [1/10] capped
|
|
206
|
-
* @example
|
|
207
|
-
* @example
|
|
227
|
+
* @example formatIndexProgress(1, 10) => [2/10]
|
|
228
|
+
* @example formatIndexProgress(11, 10) => [10/10] capped
|
|
208
229
|
*/
|
|
209
230
|
declare const formatIndexProgress: (index: number, total: number) => string;
|
|
210
231
|
|
|
@@ -216,9 +237,9 @@ declare const formatIndexProgress: (index: number, total: number) => string;
|
|
|
216
237
|
* @example formatNumber(0.12345, { percentage: true, maxDigits: 2 }) // '12.35%' (rounding)
|
|
217
238
|
*/
|
|
218
239
|
declare const formatNumber: (value: number, { compact, maxDigits, percentage, }?: {
|
|
219
|
-
compact?: boolean
|
|
220
|
-
maxDigits?: number
|
|
221
|
-
percentage?: boolean
|
|
240
|
+
compact?: boolean;
|
|
241
|
+
maxDigits?: number;
|
|
242
|
+
percentage?: boolean;
|
|
222
243
|
}) => string;
|
|
223
244
|
|
|
224
245
|
/**
|
|
@@ -227,15 +248,7 @@ declare const formatNumber: (value: number, { compact, maxDigits, percentage, }?
|
|
|
227
248
|
* @example formatPercentage(0, { digits: 2 }) => 0.00%
|
|
228
249
|
*/
|
|
229
250
|
declare const formatPercentage: (value: number, { digits, }?: {
|
|
230
|
-
digits?: number
|
|
231
|
-
}) => string;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @deprecated Use `formatIndexProgress` instead.
|
|
235
|
-
*/
|
|
236
|
-
declare const formatProgress: ({ index, total, }: {
|
|
237
|
-
index: number;
|
|
238
|
-
total: number;
|
|
251
|
+
digits?: number;
|
|
239
252
|
}) => string;
|
|
240
253
|
|
|
241
254
|
declare const stringToCSSUnicode: (text: string) => string;
|
|
@@ -272,7 +285,7 @@ declare const chunkedAll: <T>(array: T[], chunkSize: number, fn: (chunk: T[]) =>
|
|
|
272
285
|
* @param options.minChunkTimeMs - Minimum time to process each chunk
|
|
273
286
|
*/
|
|
274
287
|
declare const chunkedAsync: <T>(array: T[], chunkSize: number, fn: (chunk: T[], chunkIndex: number, chunks: T[][]) => Promise<any>, { minChunkTimeMs, }?: {
|
|
275
|
-
minChunkTimeMs?: number
|
|
288
|
+
minChunkTimeMs?: number;
|
|
276
289
|
}) => Promise<any[]>;
|
|
277
290
|
|
|
278
291
|
/**
|
|
@@ -287,11 +300,11 @@ declare const chunkedAsync: <T>(array: T[], chunkSize: number, fn: (chunk: T[],
|
|
|
287
300
|
* @param options.sleepTimeMs - Time to sleep between each chunk
|
|
288
301
|
*/
|
|
289
302
|
declare const chunkedDynamic: <T>(array: T[], initialChunkSize: number, fn: (chunk: T[], currentChunkIndex: number) => Promise<any>, { idealChunkDuration, maxChunkSize, minChunkDuration, minChunkSize, sleepTimeMs, }?: {
|
|
290
|
-
idealChunkDuration?: number
|
|
291
|
-
maxChunkSize?: number
|
|
292
|
-
minChunkDuration?: number
|
|
293
|
-
minChunkSize?: number
|
|
294
|
-
sleepTimeMs?: number
|
|
303
|
+
idealChunkDuration?: number;
|
|
304
|
+
maxChunkSize?: number;
|
|
305
|
+
minChunkDuration?: number;
|
|
306
|
+
minChunkSize?: number;
|
|
307
|
+
sleepTimeMs?: number;
|
|
295
308
|
}) => Promise<any[]>;
|
|
296
309
|
|
|
297
310
|
declare const clamp: ({ number, min, max, }: {
|
|
@@ -311,7 +324,7 @@ declare const cyclicalItem: <T>(array: T[], index: number) => T;
|
|
|
311
324
|
* Print or log helper that does not break on circular references, and expands nested objects.
|
|
312
325
|
*/
|
|
313
326
|
declare const dir: (arg: any, { maxDepth }?: {
|
|
314
|
-
maxDepth?: number
|
|
327
|
+
maxDepth?: number;
|
|
315
328
|
}) => void;
|
|
316
329
|
|
|
317
330
|
declare const enumKeys: <T extends object>(arg: T) => ObjectKeys<T>;
|
|
@@ -326,9 +339,9 @@ declare const filterAlphanumeric: (string: string) => string;
|
|
|
326
339
|
|
|
327
340
|
declare const first: <T>(arr: T[]) => T;
|
|
328
341
|
|
|
329
|
-
declare const firstKey: <T extends PlainObject
|
|
342
|
+
declare const firstKey: <T extends PlainObject>(arg: T) => ObjectKey<T>;
|
|
330
343
|
|
|
331
|
-
declare const firstValue: <T extends PlainObject
|
|
344
|
+
declare const firstValue: <T extends PlainObject>(arg: T) => ObjectValue<T>;
|
|
332
345
|
|
|
333
346
|
/**
|
|
334
347
|
* Get a client cookie by name, works only in the browser
|
|
@@ -375,7 +388,7 @@ declare const groupByKey: <T, K extends keyof T>(items: T[], key: K) => Record<k
|
|
|
375
388
|
|
|
376
389
|
declare const incrementalId: () => number;
|
|
377
390
|
|
|
378
|
-
declare const keysLength: <T extends PlainObject
|
|
391
|
+
declare const keysLength: <T extends PlainObject>(obj: T) => number;
|
|
379
392
|
|
|
380
393
|
declare const last: <T>(arr: T[]) => T;
|
|
381
394
|
|
|
@@ -392,13 +405,14 @@ declare const lastIndex: (array: any[]) => number;
|
|
|
392
405
|
* itemsById[1]; // { id: 1, name: "Alice" }
|
|
393
406
|
* itemsById[2]; // { id: 2, name: "Bob" }
|
|
394
407
|
*/
|
|
395
|
-
declare const mapByKey: <T extends PlainObject
|
|
408
|
+
declare const mapByKey: <T extends PlainObject>(items: T[], key: keyof T) => Record<Exclude<T[keyof T], null | undefined>, // any value of T, excluding null and undefined
|
|
409
|
+
T>;
|
|
396
410
|
|
|
397
411
|
/**
|
|
398
412
|
* @description Simple merge function that merges two objects, arrays get overwritten, no options
|
|
399
413
|
*
|
|
400
414
|
*/
|
|
401
|
-
declare const merge: (target: PlainObject, source: PlainObject) => PlainObject
|
|
415
|
+
declare const merge: (target: PlainObject, source: PlainObject) => PlainObject;
|
|
402
416
|
|
|
403
417
|
/**
|
|
404
418
|
* @description Merge two arrays, unique values, no options
|
|
@@ -416,9 +430,9 @@ declare const normalizeNumber: ({ value, max, min, }: {
|
|
|
416
430
|
min: number;
|
|
417
431
|
}) => number;
|
|
418
432
|
|
|
419
|
-
declare const objectDiff: (leftObject: PlainObject, rightObject: PlainObject) => PlainObject
|
|
433
|
+
declare const objectDiff: (leftObject: PlainObject, rightObject: PlainObject) => PlainObject;
|
|
420
434
|
|
|
421
|
-
declare const omit: <T extends PlainObject
|
|
435
|
+
declare const omit: <T extends PlainObject>(obj: T, keys: (keyof T)[]) => Partial<T>;
|
|
422
436
|
|
|
423
437
|
/**
|
|
424
438
|
*
|
|
@@ -437,7 +451,7 @@ declare const parseDate: (arg?: Maybe<DateLike>, options?: {
|
|
|
437
451
|
* const obj = { a: 1, b: 2, c: 3 };
|
|
438
452
|
* pickObjectKeys(obj, ["a", "c"]); // { a: 1, c: 3 }
|
|
439
453
|
*/
|
|
440
|
-
declare const pickObjectKeys: <T extends PlainObject
|
|
454
|
+
declare const pickObjectKeys: <T extends PlainObject>(obj: T, keys: ObjectKeys<T>) => Partial<T>;
|
|
441
455
|
|
|
442
456
|
/**
|
|
443
457
|
*
|
|
@@ -446,9 +460,9 @@ declare const pickObjectKeys: <T extends PlainObject<any>>(obj: T, keys: ObjectK
|
|
|
446
460
|
* const obj = { a: 1, b: 2, c: 3 };
|
|
447
461
|
* pickObjectValues(obj, [1, 3]); // { a: 1, c: 3 }
|
|
448
462
|
*/
|
|
449
|
-
declare const pickObjectValues: <T extends PlainObject
|
|
463
|
+
declare const pickObjectValues: <T extends PlainObject>(obj: T, values: ObjectValues<T>) => Partial<T>;
|
|
450
464
|
|
|
451
|
-
declare const pluck: <T extends PlainObject
|
|
465
|
+
declare const pluck: <T extends PlainObject>(items: T[], key: keyof T) => Exclude<T[keyof T], null | undefined>[];
|
|
452
466
|
|
|
453
467
|
declare const promiseWithTimeout: <T>(promise: () => Promise<T>, timeoutMs: number, error?: Error) => Promise<T>;
|
|
454
468
|
|
|
@@ -465,7 +479,7 @@ declare const scrambleText: (str: string) => string;
|
|
|
465
479
|
* @example
|
|
466
480
|
* serialize({ b: 1, a: 2 }) // '{"a":1,"b":2}'
|
|
467
481
|
*/
|
|
468
|
-
declare const serialize: <T extends PlainObject
|
|
482
|
+
declare const serialize: <T extends PlainObject>(obj: T) => string;
|
|
469
483
|
|
|
470
484
|
type AsyncFunction<T = any> = () => Promise<T>;
|
|
471
485
|
type SeriesResult<T extends readonly AsyncFunction[]> = {
|
|
@@ -482,7 +496,7 @@ type SeriesResult<T extends readonly AsyncFunction[]> = {
|
|
|
482
496
|
* async () => 4,
|
|
483
497
|
* ]); => [1, 2, 3, 4]
|
|
484
498
|
*/
|
|
485
|
-
declare const seriesAsync: <T extends readonly AsyncFunction
|
|
499
|
+
declare const seriesAsync: <T extends readonly AsyncFunction[]>(series: readonly [...T]) => Promise<SeriesResult<T>>;
|
|
486
500
|
|
|
487
501
|
/**
|
|
488
502
|
* Sets a value in an object using a dot-separated path.
|
|
@@ -502,17 +516,10 @@ declare const sleep: (timeMs: number) => Promise<void>;
|
|
|
502
516
|
declare const stringify: (arg?: any) => string;
|
|
503
517
|
|
|
504
518
|
declare const toggleArrayValue: <T>(array: T[], value: T) => T[];
|
|
505
|
-
/**
|
|
506
|
-
* @deprecated Use toggleArrayValue instead
|
|
507
|
-
* @param {T[]} array
|
|
508
|
-
* @param {T} value
|
|
509
|
-
* @returns {T[]}
|
|
510
|
-
*/
|
|
511
|
-
declare const toggleArray: <T>(array: T[], value: T) => T[];
|
|
512
519
|
|
|
513
520
|
declare const truncate: (arg: string, limit: number, { ellipsis, position, }?: {
|
|
514
|
-
ellipsis?: string
|
|
515
|
-
position?: "start" | "middle" | "end"
|
|
521
|
+
ellipsis?: string;
|
|
522
|
+
position?: "start" | "middle" | "end";
|
|
516
523
|
}) => string;
|
|
517
524
|
|
|
518
525
|
declare const uniqueValues: <T>(arr: T[]) => T[];
|
|
@@ -591,13 +598,13 @@ declare const randomAddress: () => RandomAddress;
|
|
|
591
598
|
* randomAlphaNumericCode(); => "A2G4G6"
|
|
592
599
|
*/
|
|
593
600
|
declare const randomAlphaNumericCode: ({ length, }?: {
|
|
594
|
-
length?: number
|
|
601
|
+
length?: number;
|
|
595
602
|
}) => string;
|
|
596
603
|
|
|
597
604
|
declare const randomArray: () => (string | number | boolean | symbol | Date | BigInt)[];
|
|
598
605
|
|
|
599
606
|
declare const randomArrayItem: <T>(array: T[], { weights }?: {
|
|
600
|
-
weights?: number[]
|
|
607
|
+
weights?: number[];
|
|
601
608
|
}) => T;
|
|
602
609
|
|
|
603
610
|
type BankAccount = {
|
|
@@ -645,21 +652,21 @@ declare const randomDateRange: () => {
|
|
|
645
652
|
};
|
|
646
653
|
|
|
647
654
|
declare const randomEmail: ({ handle, handleSuffix, }?: {
|
|
648
|
-
handle?: string
|
|
649
|
-
handleSuffix?: string
|
|
655
|
+
handle?: string;
|
|
656
|
+
handleSuffix?: string;
|
|
650
657
|
}) => string;
|
|
651
658
|
|
|
652
659
|
declare const randomEmoji: () => string;
|
|
653
660
|
|
|
654
661
|
declare const randomEmptyValue: () => number | null | undefined;
|
|
655
662
|
|
|
656
|
-
declare const randomEnumKey: <T extends object>(arg: T) =>
|
|
663
|
+
declare const randomEnumKey: <T extends object>(arg: T) => ObjectKey<T>;
|
|
657
664
|
|
|
658
665
|
declare const randomEnumValue: <T extends object>(arg: T) => ObjectValue<T>;
|
|
659
666
|
|
|
660
667
|
declare const randomFile: ({ name, extension, }?: {
|
|
661
|
-
name?: string
|
|
662
|
-
extension?: string
|
|
668
|
+
name?: string;
|
|
669
|
+
extension?: string;
|
|
663
670
|
}) => File | undefined;
|
|
664
671
|
|
|
665
672
|
declare const JS_MAX_DIGITS = 16;
|
|
@@ -671,7 +678,7 @@ declare const randomFloat: (min?: number, max?: number, decimals?: number) => nu
|
|
|
671
678
|
* @example "john.doe15"
|
|
672
679
|
*/
|
|
673
680
|
declare const randomHandle: ({ suffix }?: {
|
|
674
|
-
suffix?: string
|
|
681
|
+
suffix?: string;
|
|
675
682
|
}) => string;
|
|
676
683
|
|
|
677
684
|
declare const randomHexColor: () => string;
|
|
@@ -683,17 +690,17 @@ declare const randomHtmlColorName: () => string;
|
|
|
683
690
|
declare const randomIBAN: () => string;
|
|
684
691
|
|
|
685
692
|
declare const randomInt: ({ min, max, }?: {
|
|
686
|
-
min?: number
|
|
687
|
-
max?: number
|
|
693
|
+
min?: number;
|
|
694
|
+
max?: number;
|
|
688
695
|
}) => number;
|
|
689
696
|
declare const randomBigInt: () => BigInt;
|
|
690
697
|
declare const randomPositiveInt: ({ min, max, }?: {
|
|
691
|
-
min?: number
|
|
692
|
-
max?: number
|
|
698
|
+
min?: number;
|
|
699
|
+
max?: number;
|
|
693
700
|
}) => number;
|
|
694
701
|
declare const randomNegativeInt: ({ min, max, }?: {
|
|
695
|
-
min?: number
|
|
696
|
-
max?: number
|
|
702
|
+
min?: number;
|
|
703
|
+
max?: number;
|
|
697
704
|
}) => number;
|
|
698
705
|
declare const randomMaxSafeInt: () => number;
|
|
699
706
|
declare const randomMaxInt: () => number;
|
|
@@ -717,13 +724,13 @@ declare const randomFullName: () => string;
|
|
|
717
724
|
* randomNumericCode({ length: 4 }); => "1234"
|
|
718
725
|
*/
|
|
719
726
|
declare const randomNumericCode: ({ length }?: {
|
|
720
|
-
length?: number
|
|
727
|
+
length?: number;
|
|
721
728
|
}) => string;
|
|
722
729
|
|
|
723
730
|
declare const randomObject: ({ maxDepth, circular, }?: {
|
|
724
|
-
maxDepth?: number
|
|
725
|
-
circular?: boolean
|
|
726
|
-
}) => PlainObject
|
|
731
|
+
maxDepth?: number;
|
|
732
|
+
circular?: boolean;
|
|
733
|
+
}) => PlainObject;
|
|
727
734
|
|
|
728
735
|
/**
|
|
729
736
|
* Generates a random paragraph of text.
|
|
@@ -732,24 +739,24 @@ declare const randomObject: ({ maxDepth, circular, }?: {
|
|
|
732
739
|
* @returns A random paragraph of text.
|
|
733
740
|
*/
|
|
734
741
|
declare const randomParagraph: ({ maxCharacters, minWords, maxWords, }?: {
|
|
735
|
-
maxCharacters?: number
|
|
736
|
-
minWords?: number
|
|
737
|
-
maxWords?: number
|
|
742
|
+
maxCharacters?: number;
|
|
743
|
+
minWords?: number;
|
|
744
|
+
maxWords?: number;
|
|
738
745
|
}) => string;
|
|
739
746
|
|
|
740
747
|
declare const randomPassword: ({ minChars, maxChars, }?: {
|
|
741
|
-
minChars?: number
|
|
742
|
-
maxChars?: number
|
|
748
|
+
minChars?: number;
|
|
749
|
+
maxChars?: number;
|
|
743
750
|
}) => string;
|
|
744
751
|
|
|
745
752
|
declare const randomPath: ({ depth, }?: {
|
|
746
|
-
depth?: number
|
|
753
|
+
depth?: number;
|
|
747
754
|
}) => string;
|
|
748
755
|
|
|
749
756
|
declare const randomPhoneNumber: () => string;
|
|
750
757
|
|
|
751
758
|
declare const randomString: ({ length, }?: {
|
|
752
|
-
length?: number
|
|
759
|
+
length?: number;
|
|
753
760
|
}) => string;
|
|
754
761
|
|
|
755
762
|
declare const randomSymbol: () => symbol;
|
|
@@ -775,6 +782,19 @@ declare const isArray: <T>(arg?: any) => arg is T[];
|
|
|
775
782
|
|
|
776
783
|
declare const isArrayIncluded: <T>(arr1: T[], arr2: T[]) => boolean;
|
|
777
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Checks if a date falls between two other dates (left inclusive)
|
|
787
|
+
* @param date The date to check
|
|
788
|
+
* @param dateRange The date range to check against
|
|
789
|
+
* @returns true if the date is between the start and end dates (includes startDate, excludes endDate)
|
|
790
|
+
*
|
|
791
|
+
* @example
|
|
792
|
+
* isBetweenDates("2023-06-15", { startDate: "2023-01-01", endDate: "2023-12-31" }) // true
|
|
793
|
+
* isBetweenDates("2023-01-01", { startDate: "2023-01-01", endDate: "2023-12-31" }) // true (includes start)
|
|
794
|
+
* isBetweenDates("2023-12-31", { startDate: "2023-01-01", endDate: "2023-12-31" }) // false (excludes end)
|
|
795
|
+
*/
|
|
796
|
+
declare const isBetweenDates: (date: DateLike, dateRange: DateRange) => boolean;
|
|
797
|
+
|
|
778
798
|
declare const isBoolean: (arg: any) => arg is boolean;
|
|
779
799
|
|
|
780
800
|
declare const isBrowser: () => boolean;
|
|
@@ -797,11 +817,14 @@ declare const isFile: (arg?: any) => arg is File;
|
|
|
797
817
|
*/
|
|
798
818
|
declare const isFunction: (arg: any) => arg is Function;
|
|
799
819
|
|
|
800
|
-
declare const isFutureDate: (arg: DateLike
|
|
820
|
+
declare const isFutureDate: (arg: DateLike, { referenceDate }?: {
|
|
821
|
+
referenceDate?: DateLike;
|
|
822
|
+
}) => boolean;
|
|
801
823
|
|
|
802
824
|
declare const isJsDate: (arg: Date) => arg is Date;
|
|
803
825
|
|
|
804
|
-
declare const isKey: <T extends PlainObject
|
|
826
|
+
declare const isKey: <T extends PlainObject>(key: Key, // cannot use PlainKey here because it does not include symbol (keyof T does)
|
|
827
|
+
obj: T) => key is keyof T;
|
|
805
828
|
|
|
806
829
|
declare const isLastIndex: (index: number, array: any[]) => boolean;
|
|
807
830
|
|
|
@@ -810,15 +833,7 @@ declare const isNotEmptyString: (arg: any) => boolean;
|
|
|
810
833
|
declare const isInt: (arg: any) => boolean;
|
|
811
834
|
declare const isEven: (arg: any) => boolean;
|
|
812
835
|
declare const isOdd: (arg: any) => boolean;
|
|
813
|
-
/**
|
|
814
|
-
* @deprecated use isPositiveInt instead
|
|
815
|
-
*/
|
|
816
|
-
declare const isPositive: (arg: any) => boolean;
|
|
817
836
|
declare const isPositiveInt: (arg: any) => boolean;
|
|
818
|
-
/**
|
|
819
|
-
* @deprecated use isNegativeInt instead
|
|
820
|
-
*/
|
|
821
|
-
declare const isNegative: (arg: any) => boolean;
|
|
822
837
|
declare const isNegativeInt: (arg: any) => boolean;
|
|
823
838
|
declare const isNumber: (arg: any) => arg is number;
|
|
824
839
|
declare const isBigInt: (arg: any) => arg is BigInt;
|
|
@@ -840,9 +855,11 @@ declare const isNumericId: (id: string) => boolean;
|
|
|
840
855
|
|
|
841
856
|
declare const isObject: <T>(arg?: any) => arg is PlainObject<T>;
|
|
842
857
|
|
|
843
|
-
declare const isPastDate: (arg: DateLike
|
|
858
|
+
declare const isPastDate: (arg: DateLike, { referenceDate }?: {
|
|
859
|
+
referenceDate?: DateLike;
|
|
860
|
+
}) => boolean;
|
|
844
861
|
|
|
845
|
-
declare const isPromise: (arg: any) =>
|
|
862
|
+
declare const isPromise: (arg: any) => arg is Promise<any>;
|
|
846
863
|
|
|
847
864
|
declare const isPWA: () => boolean;
|
|
848
865
|
|
|
@@ -876,4 +893,4 @@ declare const isUUID: (arg: string) => boolean;
|
|
|
876
893
|
|
|
877
894
|
declare const isValue: <T>(arg?: Maybe<T>) => arg is T;
|
|
878
895
|
|
|
879
|
-
export { BoolMap, Coords, DateLike, DateRange, DateSeries, Datey, Defined, Dimensions, HashMap, ISODate, ISODay, ISOMonth, ISOYear, JS_MAX_DIGITS, Key, Matrix, Maybe, MaybePromise, MaybePromiseOrValue, MaybePromiseOrValueArray, NonUndefined, NumberMap, ObjectEntries, ObjectEntry, ObjectKey, ObjectKeys, ObjectValue, ObjectValues, PickDefined, PickRequired, PlainKey, PlainObject, Point, PrismaSelect, Serialized, StringMap, Timezone, TrueMap, VoidFn, array, arrayDiff, arrayIntersection, average, capitalize, chunkArray, chunkedAll, chunkedAsync, chunkedDynamic, clamp, cleanSpaces, cyclicalItem, dir, enumKeys, enumValues, filterAlphanumeric, first, firstKey, firstValue, formatCamelCase, formatCookies, formatIndexProgress, formatNumber, formatPercentage,
|
|
896
|
+
export { type BoolMap, type Coords, type DateLike, type DateRange, type DateSeries, type Datey, type Defined, type Dimensions, type HashMap, type ISODate, type ISODay, type ISOMonth, type ISOYear, JS_MAX_DIGITS, type Key, type Matrix, type Maybe, type MaybePromise, type MaybePromiseOrValue, type MaybePromiseOrValueArray, type NonUndefined, type NumberMap, type ObjectEntries, type ObjectEntry, type ObjectKey, type ObjectKeys, type ObjectValue, type ObjectValues, type PickDefined, type PickRequired, type PlainKey, type PlainObject, type Point, type PrismaSelect, type Serialized, type StringMap, type Timezone, type TrueMap, type VoidFn, array, arrayDiff, arrayIntersection, average, bucketSortedDates, capitalize, chunkArray, chunkedAll, chunkedAsync, chunkedDynamic, clamp, cleanSpaces, cyclicalItem, dir, enumKeys, enumValues, filterAlphanumeric, first, firstKey, firstValue, formatCamelCase, formatCookies, formatIndexProgress, formatNumber, formatPercentage, formatTrpcInputQueryString, getCookieByName, getDateRangeSeries, getDateSeriesRange, getKeys, getUrlSearchParam, getUrlSearchParams, groupByDateBucket, groupByKey, incrementalId, isArray, isArrayIncluded, isBetween, isBetweenDates, isBigInt, isBigIntString, isBoolean, isBrowser, isBuffer, isClient, isEmail, isEmpty, isEmptyArray, isEmptyObject, isEmptyString, isEven, isFile, isFunction, isFutureDate, isInt, isJsDate, isKey, isLastIndex, isNegativeInt, isNotEmptyString, isNumber, isNumeric, isNumericId, isObject, isOdd, isOutside, isOutsideInt4, isOver18, isPWA, isPastDate, isPositiveInt, isPromise, isReactElement, isRegExp, isSame, isSequence, isServer, isSpacedString, isStrictlyBetween, isString, isStringDate, isURL, isUUID, isValue, keysLength, last, lastIndex, mapByKey, max, merge, mergeArrays, min, moveToFirst, moveToLast, multiply, noop, normaliseArray, normaliseNumber, normalizeNumber, objectDiff, omit, parseDate, percentageChange, pickObjectKeys, pickObjectValues, pluck, prismaDateRange, promiseWithTimeout, randomAddress, randomAlphaNumericCode, randomArray, randomArrayItem, randomBankAccount, randomBigInt, randomBool, randomChar, randomCompany, randomCoords, randomDate, randomDateRange, randomEmail, randomEmoji, randomEmptyValue, randomEnumKey, randomEnumValue, randomFile, randomFirstName, randomFloat, randomFormattedPercentage, randomFullName, randomFutureDate, randomHandle, randomHexColor, randomHexValue, randomHtmlColorName, randomIBAN, randomIP, randomInt, randomLastName, randomLat, randomLng, randomMaxDate, randomMaxInt, randomMaxSafeInt, randomName, randomNegativeInt, randomNoun, randomNumericCode, randomObject, randomParagraph, randomPassword, randomPastDate, randomPath, randomPhoneNumber, randomPositiveInt, randomString, randomSymbol, randomUUID, randomValue, randomVerb, randomWord, removeUndefinedValues, scrambleText, serialize, seriesAsync, setObjectPath, setUrlSearchParams, shuffle, sleep, startOfDay, startOfNextMonth, startOfNextWeek, startOfThisWeek, startOfToday, startOfTomorrow, startOfUTCDay, startOfUTCTomorrow, stringToCSSUnicode, stringToUnicode, stringify, sum, toggleArrayValue, truncate, uniqueValues };
|