@h3ravel/support 0.12.0 → 0.13.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/dist/app.globals.d.ts +3 -3
- package/dist/index.cjs +196 -184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -106
- package/dist/index.d.ts +113 -106
- package/dist/index.js +187 -176
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -40,7 +40,7 @@ type XGeneric<V = TGeneric, T = any> = {
|
|
|
40
40
|
[key: string]: T;
|
|
41
41
|
} & V;
|
|
42
42
|
declare namespace Arr_d_exports {
|
|
43
|
-
export { alternate, chunk, collapse, combine, find, first, flatten, forget, isEmpty, isNotEmpty, last, pop, prepend, range, reverse, shift, take };
|
|
43
|
+
export { alternate, chunk, collapse, combine, find, first, flatten, forget, isEmpty, isNotEmpty, last, pop, prepend, range, reverse, shift, take, wrap };
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Splits an array into chunks of a specified size.
|
|
@@ -95,6 +95,13 @@ declare const shift: <T>(arr: T[]) => [T, T[]];
|
|
|
95
95
|
declare const range: (size: number, startAt?: number) => number[];
|
|
96
96
|
/** Flatten multi-dimensional arrays into single level. */
|
|
97
97
|
declare const flatten: <T>(arr: T[]) => T[];
|
|
98
|
+
/**
|
|
99
|
+
* If the given value is not an array and not null, wrap it in one.
|
|
100
|
+
*
|
|
101
|
+
* @param {Array} value
|
|
102
|
+
* @return array
|
|
103
|
+
*/
|
|
104
|
+
declare const wrap: <A>(value: A | A[]) => A[];
|
|
98
105
|
declare namespace Crypto_d_exports {
|
|
99
106
|
export { base64Decode, base64Encode, caesarCipher, checksum, hash, hmac, random, randomColor, randomPassword, randomSecure, secureToken, uuid, verifyChecksum, xor };
|
|
100
107
|
}
|
|
@@ -346,6 +353,108 @@ declare const setNested: (obj: Record<string, any>, key: string, value: any) =>
|
|
|
346
353
|
*/
|
|
347
354
|
declare const slugifyKeys: <T extends object>(obj: T, only?: string[], separator?: string) => KeysToSnakeCase<T>;
|
|
348
355
|
//#endregion
|
|
356
|
+
//#region src/Helpers/Time.d.ts
|
|
357
|
+
declare function format(date: ConfigType, fmt: string): string;
|
|
358
|
+
declare const TimeClass: {
|
|
359
|
+
new (date?: dayjs.ConfigType): Dayjs;
|
|
360
|
+
} & typeof Dayjs;
|
|
361
|
+
declare class DateTime extends TimeClass {
|
|
362
|
+
private instance;
|
|
363
|
+
constructor(config?: ConfigType);
|
|
364
|
+
/**
|
|
365
|
+
* Start time of a specific unit.
|
|
366
|
+
*
|
|
367
|
+
* @returns
|
|
368
|
+
*/
|
|
369
|
+
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
370
|
+
/**
|
|
371
|
+
* End time of a specific unit.
|
|
372
|
+
*
|
|
373
|
+
* @returns
|
|
374
|
+
*/
|
|
375
|
+
end(unit?: OpUnitType): dayjs.Dayjs;
|
|
376
|
+
/**
|
|
377
|
+
* Get the first day of the month of the given date
|
|
378
|
+
*
|
|
379
|
+
* @returns
|
|
380
|
+
*/
|
|
381
|
+
firstDayOfMonth(): DateTime;
|
|
382
|
+
carbonFormat(template?: string | undefined): string;
|
|
383
|
+
/**
|
|
384
|
+
* Get the last day of the month of the given date
|
|
385
|
+
*
|
|
386
|
+
* @returns
|
|
387
|
+
*/
|
|
388
|
+
lastDayOfMonth(): DateTime;
|
|
389
|
+
/**
|
|
390
|
+
* Get a random time between the specified hour and minute.
|
|
391
|
+
*
|
|
392
|
+
* @param startHour
|
|
393
|
+
* @param startMinute
|
|
394
|
+
* @param endHour
|
|
395
|
+
* @param endMinute
|
|
396
|
+
* @returns
|
|
397
|
+
*/
|
|
398
|
+
randomTime(startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): DateTime;
|
|
399
|
+
/**
|
|
400
|
+
* Create a date for a given timestamp.
|
|
401
|
+
*
|
|
402
|
+
* @param timestamp - Unix timestamp
|
|
403
|
+
*
|
|
404
|
+
* @return {Date} object
|
|
405
|
+
*/
|
|
406
|
+
static fromTimestamp(timestamp: number): Date;
|
|
407
|
+
/**
|
|
408
|
+
* Get current time instance.
|
|
409
|
+
*
|
|
410
|
+
* @returns Current time
|
|
411
|
+
*/
|
|
412
|
+
static now(): DateTime;
|
|
413
|
+
/**
|
|
414
|
+
* Parse the time
|
|
415
|
+
*
|
|
416
|
+
* @param date
|
|
417
|
+
* @returns
|
|
418
|
+
*/
|
|
419
|
+
static parse(date: dayjs.ConfigType): DateTime;
|
|
420
|
+
/**
|
|
421
|
+
* Get the formatted date according to the string of tokens passed in.
|
|
422
|
+
*
|
|
423
|
+
* To escape characters, wrap them in square brackets (e.g. [MM]).
|
|
424
|
+
*
|
|
425
|
+
* @param time - current time
|
|
426
|
+
* @param template - time format
|
|
427
|
+
*/
|
|
428
|
+
static format(time?: ConfigType, template?: string | undefined): string;
|
|
429
|
+
/**
|
|
430
|
+
* Get the difference in days from today.
|
|
431
|
+
*
|
|
432
|
+
* @param time
|
|
433
|
+
* @param startHour
|
|
434
|
+
* @param startMinute
|
|
435
|
+
* @param endHour
|
|
436
|
+
* @param endMinute
|
|
437
|
+
* @returns
|
|
438
|
+
*/
|
|
439
|
+
static randomTime(time?: ConfigType, startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): DateTime;
|
|
440
|
+
/**
|
|
441
|
+
* Get the first day of the month of the given date
|
|
442
|
+
*
|
|
443
|
+
* @param time
|
|
444
|
+
*
|
|
445
|
+
* @returns
|
|
446
|
+
*/
|
|
447
|
+
static firstDayOfMonth(time: ConfigType): DateTime;
|
|
448
|
+
/**
|
|
449
|
+
* Get the last day of the month of the given date
|
|
450
|
+
*
|
|
451
|
+
* @param time
|
|
452
|
+
*
|
|
453
|
+
* @returns
|
|
454
|
+
*/
|
|
455
|
+
static lastDayOfMonth(time: ConfigType): DateTime;
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
349
458
|
//#region src/Helpers/Str.d.ts
|
|
350
459
|
declare enum Mode {
|
|
351
460
|
MB_CASE_UPPER = 0,
|
|
@@ -2586,112 +2695,10 @@ declare class HtmlString {
|
|
|
2586
2695
|
*/
|
|
2587
2696
|
declare function str(string?: string): Stringable;
|
|
2588
2697
|
//#endregion
|
|
2589
|
-
//#region src/Helpers/Time.d.ts
|
|
2590
|
-
declare function format(date: ConfigType, fmt: string): string;
|
|
2591
|
-
declare const TimeClass: {
|
|
2592
|
-
new (date?: dayjs.ConfigType): Dayjs;
|
|
2593
|
-
} & typeof Dayjs;
|
|
2594
|
-
declare class Time extends TimeClass {
|
|
2595
|
-
private instance;
|
|
2596
|
-
constructor(config?: ConfigType);
|
|
2597
|
-
/**
|
|
2598
|
-
* Start time of a specific unit.
|
|
2599
|
-
*
|
|
2600
|
-
* @returns
|
|
2601
|
-
*/
|
|
2602
|
-
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
2603
|
-
/**
|
|
2604
|
-
* End time of a specific unit.
|
|
2605
|
-
*
|
|
2606
|
-
* @returns
|
|
2607
|
-
*/
|
|
2608
|
-
end(unit?: OpUnitType): dayjs.Dayjs;
|
|
2609
|
-
/**
|
|
2610
|
-
* Get the first day of the month of the given date
|
|
2611
|
-
*
|
|
2612
|
-
* @returns
|
|
2613
|
-
*/
|
|
2614
|
-
firstDayOfMonth(): Time;
|
|
2615
|
-
carbonFormat(template?: string | undefined): string;
|
|
2616
|
-
/**
|
|
2617
|
-
* Get the last day of the month of the given date
|
|
2618
|
-
*
|
|
2619
|
-
* @returns
|
|
2620
|
-
*/
|
|
2621
|
-
lastDayOfMonth(): Time;
|
|
2622
|
-
/**
|
|
2623
|
-
* Get a random time between the specified hour and minute.
|
|
2624
|
-
*
|
|
2625
|
-
* @param startHour
|
|
2626
|
-
* @param startMinute
|
|
2627
|
-
* @param endHour
|
|
2628
|
-
* @param endMinute
|
|
2629
|
-
* @returns
|
|
2630
|
-
*/
|
|
2631
|
-
randomTime(startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): Time;
|
|
2632
|
-
/**
|
|
2633
|
-
* Create a date for a given timestamp.
|
|
2634
|
-
*
|
|
2635
|
-
* @param timestamp - Unix timestamp
|
|
2636
|
-
*
|
|
2637
|
-
* @return {Date} object
|
|
2638
|
-
*/
|
|
2639
|
-
static fromTimestamp(timestamp: number): Date;
|
|
2640
|
-
/**
|
|
2641
|
-
* Get current time instance.
|
|
2642
|
-
*
|
|
2643
|
-
* @returns Current time
|
|
2644
|
-
*/
|
|
2645
|
-
static now(): Time;
|
|
2646
|
-
/**
|
|
2647
|
-
* Parse the time
|
|
2648
|
-
*
|
|
2649
|
-
* @param date
|
|
2650
|
-
* @returns
|
|
2651
|
-
*/
|
|
2652
|
-
static parse(date: dayjs.ConfigType): Time;
|
|
2653
|
-
/**
|
|
2654
|
-
* Get the formatted date according to the string of tokens passed in.
|
|
2655
|
-
*
|
|
2656
|
-
* To escape characters, wrap them in square brackets (e.g. [MM]).
|
|
2657
|
-
*
|
|
2658
|
-
* @param time - current time
|
|
2659
|
-
* @param template - time format
|
|
2660
|
-
*/
|
|
2661
|
-
static format(time?: ConfigType, template?: string | undefined): string;
|
|
2662
|
-
/**
|
|
2663
|
-
* Get the difference in days from today.
|
|
2664
|
-
*
|
|
2665
|
-
* @param time
|
|
2666
|
-
* @param startHour
|
|
2667
|
-
* @param startMinute
|
|
2668
|
-
* @param endHour
|
|
2669
|
-
* @param endMinute
|
|
2670
|
-
* @returns
|
|
2671
|
-
*/
|
|
2672
|
-
static randomTime(time?: ConfigType, startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): Time;
|
|
2673
|
-
/**
|
|
2674
|
-
* Get the first day of the month of the given date
|
|
2675
|
-
*
|
|
2676
|
-
* @param time
|
|
2677
|
-
*
|
|
2678
|
-
* @returns
|
|
2679
|
-
*/
|
|
2680
|
-
static firstDayOfMonth(time: ConfigType): Time;
|
|
2681
|
-
/**
|
|
2682
|
-
* Get the last day of the month of the given date
|
|
2683
|
-
*
|
|
2684
|
-
* @param time
|
|
2685
|
-
*
|
|
2686
|
-
* @returns
|
|
2687
|
-
*/
|
|
2688
|
-
static lastDayOfMonth(time: ConfigType): Time;
|
|
2689
|
-
}
|
|
2690
|
-
//#endregion
|
|
2691
2698
|
//#region src/GlobalBootstrap.d.ts
|
|
2692
2699
|
type CollapseStatics<T extends Record<string, any>> = { [K in keyof T]: T[K] };
|
|
2693
2700
|
type Omitables = 'start' | 'take' | 'reverse' | 'chunk' | 'find' | 'pop' | 'end' | 'shift' | 'push' | 'at' | 'prototype' | 'concat' | 'join' | 'slice' | 'sort' | 'splice' | 'includes' | 'indexOf' | 'lastIndexOf' | 'findIndex' | 'every' | 'some' | 'forEach' | 'map' | 'filter' | 'reduce' | 'unshift' | 'flat' | 'flatMap' | 'keys' | 'fill' | 'copyWithin' | 'entries' | 'values' | 'reduceRight' | 'length' | 'of' | typeof Symbol.unscopables | typeof Symbol.iterator;
|
|
2694
|
-
type TakeTime = Pick<typeof
|
|
2701
|
+
type TakeTime = Pick<typeof DateTime, 'now' | 'format' | 'fromTimestamp' | 'randomTime' | 'firstDayOfMonth' | 'lastDayOfMonth' | 'parse'>;
|
|
2695
2702
|
type TakeString = Pick<typeof Str, 'after' | 'afterLast' | 'apa' | 'ascii' | 'before' | 'beforeLast' | 'between' | 'betweenFirst' | 'capitalize' | 'plural' | 'singular' | 'title'>;
|
|
2696
2703
|
/**
|
|
2697
2704
|
* Global helpers interface that mirrors Laravel's helpers
|
|
@@ -2702,9 +2709,9 @@ interface GlobalHelpers extends Omit<CollapseStatics<typeof Arr_d_exports>, Omit
|
|
|
2702
2709
|
Str: typeof Str;
|
|
2703
2710
|
Obj: typeof Obj_d_exports;
|
|
2704
2711
|
Crypto: typeof Crypto_d_exports;
|
|
2705
|
-
Time: typeof Time;
|
|
2706
2712
|
Number: typeof Number_d_exports;
|
|
2707
2713
|
DumpDie: typeof DumpDie_d_exports;
|
|
2714
|
+
DateTime: typeof DateTime;
|
|
2708
2715
|
}
|
|
2709
2716
|
/**
|
|
2710
2717
|
* Bootstrap the global helpers into the global scope.
|
|
@@ -2737,5 +2744,5 @@ declare function loadHelpers(target?: any): void;
|
|
|
2737
2744
|
*/
|
|
2738
2745
|
declare function cleanHelpers(target?: any): void;
|
|
2739
2746
|
//#endregion
|
|
2740
|
-
export { Arr_d_exports as Arr, Callback, CamelToSnakeCase, Crypto_d_exports as Crypto, DumpDie_d_exports as DumpDie, ExcerptOptions, Fallback, Function, GlobalHelpers, HtmlString, HtmlStringType, KeysToSnakeCase, Mode, Number_d_exports as Number, Obj_d_exports as Obj, SnakeToCamelCase, SnakeToTitleCase, Str, Stringable, TGeneric,
|
|
2747
|
+
export { Arr_d_exports as Arr, Callback, CamelToSnakeCase, Crypto_d_exports as Crypto, DateTime, DumpDie_d_exports as DumpDie, ExcerptOptions, Fallback, Function, GlobalHelpers, HtmlString, HtmlStringType, KeysToSnakeCase, Mode, Number_d_exports as Number, Obj_d_exports as Obj, SnakeToCamelCase, SnakeToTitleCase, Str, Stringable, TGeneric, Value, XGeneric, abbreviate, alternate, base64Decode, base64Encode, caesarCipher, checksum, chunk, cleanHelpers, collapse, combine, dd, dot, dump, extractProperties, find, first, flatten, forget, format, getValue, hash, hmac, humanize, isEmpty, isNotEmpty, last, loadHelpers, modObj, pop, prepend, random, randomColor, randomPassword, randomSecure, range, reverse, safeDot, secureToken, setNested, shift, slugifyKeys, str, take, toBytes, toHumanTime, uuid, verifyChecksum, wrap, xor };
|
|
2741
2748
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ type XGeneric<V = TGeneric, T = any> = {
|
|
|
37
37
|
[key: string]: T;
|
|
38
38
|
} & V;
|
|
39
39
|
declare namespace Arr_d_exports {
|
|
40
|
-
export { alternate, chunk, collapse, combine, find, first, flatten, forget, isEmpty, isNotEmpty, last, pop, prepend, range, reverse, shift, take };
|
|
40
|
+
export { alternate, chunk, collapse, combine, find, first, flatten, forget, isEmpty, isNotEmpty, last, pop, prepend, range, reverse, shift, take, wrap };
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Splits an array into chunks of a specified size.
|
|
@@ -92,6 +92,13 @@ declare const shift: <T>(arr: T[]) => [T, T[]];
|
|
|
92
92
|
declare const range: (size: number, startAt?: number) => number[];
|
|
93
93
|
/** Flatten multi-dimensional arrays into single level. */
|
|
94
94
|
declare const flatten: <T>(arr: T[]) => T[];
|
|
95
|
+
/**
|
|
96
|
+
* If the given value is not an array and not null, wrap it in one.
|
|
97
|
+
*
|
|
98
|
+
* @param {Array} value
|
|
99
|
+
* @return array
|
|
100
|
+
*/
|
|
101
|
+
declare const wrap: <A>(value: A | A[]) => A[];
|
|
95
102
|
declare namespace Crypto_d_exports {
|
|
96
103
|
export { base64Decode, base64Encode, caesarCipher, checksum, hash, hmac, random, randomColor, randomPassword, randomSecure, secureToken, uuid, verifyChecksum, xor };
|
|
97
104
|
}
|
|
@@ -343,6 +350,108 @@ declare const setNested: (obj: Record<string, any>, key: string, value: any) =>
|
|
|
343
350
|
*/
|
|
344
351
|
declare const slugifyKeys: <T extends object>(obj: T, only?: string[], separator?: string) => KeysToSnakeCase<T>;
|
|
345
352
|
//#endregion
|
|
353
|
+
//#region src/Helpers/Time.d.ts
|
|
354
|
+
declare function format(date: ConfigType, fmt: string): string;
|
|
355
|
+
declare const TimeClass: {
|
|
356
|
+
new (date?: dayjs.ConfigType): Dayjs;
|
|
357
|
+
} & typeof Dayjs;
|
|
358
|
+
declare class DateTime extends TimeClass {
|
|
359
|
+
private instance;
|
|
360
|
+
constructor(config?: ConfigType);
|
|
361
|
+
/**
|
|
362
|
+
* Start time of a specific unit.
|
|
363
|
+
*
|
|
364
|
+
* @returns
|
|
365
|
+
*/
|
|
366
|
+
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
367
|
+
/**
|
|
368
|
+
* End time of a specific unit.
|
|
369
|
+
*
|
|
370
|
+
* @returns
|
|
371
|
+
*/
|
|
372
|
+
end(unit?: OpUnitType): dayjs.Dayjs;
|
|
373
|
+
/**
|
|
374
|
+
* Get the first day of the month of the given date
|
|
375
|
+
*
|
|
376
|
+
* @returns
|
|
377
|
+
*/
|
|
378
|
+
firstDayOfMonth(): DateTime;
|
|
379
|
+
carbonFormat(template?: string | undefined): string;
|
|
380
|
+
/**
|
|
381
|
+
* Get the last day of the month of the given date
|
|
382
|
+
*
|
|
383
|
+
* @returns
|
|
384
|
+
*/
|
|
385
|
+
lastDayOfMonth(): DateTime;
|
|
386
|
+
/**
|
|
387
|
+
* Get a random time between the specified hour and minute.
|
|
388
|
+
*
|
|
389
|
+
* @param startHour
|
|
390
|
+
* @param startMinute
|
|
391
|
+
* @param endHour
|
|
392
|
+
* @param endMinute
|
|
393
|
+
* @returns
|
|
394
|
+
*/
|
|
395
|
+
randomTime(startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): DateTime;
|
|
396
|
+
/**
|
|
397
|
+
* Create a date for a given timestamp.
|
|
398
|
+
*
|
|
399
|
+
* @param timestamp - Unix timestamp
|
|
400
|
+
*
|
|
401
|
+
* @return {Date} object
|
|
402
|
+
*/
|
|
403
|
+
static fromTimestamp(timestamp: number): Date;
|
|
404
|
+
/**
|
|
405
|
+
* Get current time instance.
|
|
406
|
+
*
|
|
407
|
+
* @returns Current time
|
|
408
|
+
*/
|
|
409
|
+
static now(): DateTime;
|
|
410
|
+
/**
|
|
411
|
+
* Parse the time
|
|
412
|
+
*
|
|
413
|
+
* @param date
|
|
414
|
+
* @returns
|
|
415
|
+
*/
|
|
416
|
+
static parse(date: dayjs.ConfigType): DateTime;
|
|
417
|
+
/**
|
|
418
|
+
* Get the formatted date according to the string of tokens passed in.
|
|
419
|
+
*
|
|
420
|
+
* To escape characters, wrap them in square brackets (e.g. [MM]).
|
|
421
|
+
*
|
|
422
|
+
* @param time - current time
|
|
423
|
+
* @param template - time format
|
|
424
|
+
*/
|
|
425
|
+
static format(time?: ConfigType, template?: string | undefined): string;
|
|
426
|
+
/**
|
|
427
|
+
* Get the difference in days from today.
|
|
428
|
+
*
|
|
429
|
+
* @param time
|
|
430
|
+
* @param startHour
|
|
431
|
+
* @param startMinute
|
|
432
|
+
* @param endHour
|
|
433
|
+
* @param endMinute
|
|
434
|
+
* @returns
|
|
435
|
+
*/
|
|
436
|
+
static randomTime(time?: ConfigType, startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): DateTime;
|
|
437
|
+
/**
|
|
438
|
+
* Get the first day of the month of the given date
|
|
439
|
+
*
|
|
440
|
+
* @param time
|
|
441
|
+
*
|
|
442
|
+
* @returns
|
|
443
|
+
*/
|
|
444
|
+
static firstDayOfMonth(time: ConfigType): DateTime;
|
|
445
|
+
/**
|
|
446
|
+
* Get the last day of the month of the given date
|
|
447
|
+
*
|
|
448
|
+
* @param time
|
|
449
|
+
*
|
|
450
|
+
* @returns
|
|
451
|
+
*/
|
|
452
|
+
static lastDayOfMonth(time: ConfigType): DateTime;
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
346
455
|
//#region src/Helpers/Str.d.ts
|
|
347
456
|
declare enum Mode {
|
|
348
457
|
MB_CASE_UPPER = 0,
|
|
@@ -2583,112 +2692,10 @@ declare class HtmlString {
|
|
|
2583
2692
|
*/
|
|
2584
2693
|
declare function str(string?: string): Stringable;
|
|
2585
2694
|
//#endregion
|
|
2586
|
-
//#region src/Helpers/Time.d.ts
|
|
2587
|
-
declare function format(date: ConfigType, fmt: string): string;
|
|
2588
|
-
declare const TimeClass: {
|
|
2589
|
-
new (date?: dayjs.ConfigType): Dayjs;
|
|
2590
|
-
} & typeof Dayjs;
|
|
2591
|
-
declare class Time extends TimeClass {
|
|
2592
|
-
private instance;
|
|
2593
|
-
constructor(config?: ConfigType);
|
|
2594
|
-
/**
|
|
2595
|
-
* Start time of a specific unit.
|
|
2596
|
-
*
|
|
2597
|
-
* @returns
|
|
2598
|
-
*/
|
|
2599
|
-
start(unit?: OpUnitType): dayjs.Dayjs;
|
|
2600
|
-
/**
|
|
2601
|
-
* End time of a specific unit.
|
|
2602
|
-
*
|
|
2603
|
-
* @returns
|
|
2604
|
-
*/
|
|
2605
|
-
end(unit?: OpUnitType): dayjs.Dayjs;
|
|
2606
|
-
/**
|
|
2607
|
-
* Get the first day of the month of the given date
|
|
2608
|
-
*
|
|
2609
|
-
* @returns
|
|
2610
|
-
*/
|
|
2611
|
-
firstDayOfMonth(): Time;
|
|
2612
|
-
carbonFormat(template?: string | undefined): string;
|
|
2613
|
-
/**
|
|
2614
|
-
* Get the last day of the month of the given date
|
|
2615
|
-
*
|
|
2616
|
-
* @returns
|
|
2617
|
-
*/
|
|
2618
|
-
lastDayOfMonth(): Time;
|
|
2619
|
-
/**
|
|
2620
|
-
* Get a random time between the specified hour and minute.
|
|
2621
|
-
*
|
|
2622
|
-
* @param startHour
|
|
2623
|
-
* @param startMinute
|
|
2624
|
-
* @param endHour
|
|
2625
|
-
* @param endMinute
|
|
2626
|
-
* @returns
|
|
2627
|
-
*/
|
|
2628
|
-
randomTime(startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): Time;
|
|
2629
|
-
/**
|
|
2630
|
-
* Create a date for a given timestamp.
|
|
2631
|
-
*
|
|
2632
|
-
* @param timestamp - Unix timestamp
|
|
2633
|
-
*
|
|
2634
|
-
* @return {Date} object
|
|
2635
|
-
*/
|
|
2636
|
-
static fromTimestamp(timestamp: number): Date;
|
|
2637
|
-
/**
|
|
2638
|
-
* Get current time instance.
|
|
2639
|
-
*
|
|
2640
|
-
* @returns Current time
|
|
2641
|
-
*/
|
|
2642
|
-
static now(): Time;
|
|
2643
|
-
/**
|
|
2644
|
-
* Parse the time
|
|
2645
|
-
*
|
|
2646
|
-
* @param date
|
|
2647
|
-
* @returns
|
|
2648
|
-
*/
|
|
2649
|
-
static parse(date: dayjs.ConfigType): Time;
|
|
2650
|
-
/**
|
|
2651
|
-
* Get the formatted date according to the string of tokens passed in.
|
|
2652
|
-
*
|
|
2653
|
-
* To escape characters, wrap them in square brackets (e.g. [MM]).
|
|
2654
|
-
*
|
|
2655
|
-
* @param time - current time
|
|
2656
|
-
* @param template - time format
|
|
2657
|
-
*/
|
|
2658
|
-
static format(time?: ConfigType, template?: string | undefined): string;
|
|
2659
|
-
/**
|
|
2660
|
-
* Get the difference in days from today.
|
|
2661
|
-
*
|
|
2662
|
-
* @param time
|
|
2663
|
-
* @param startHour
|
|
2664
|
-
* @param startMinute
|
|
2665
|
-
* @param endHour
|
|
2666
|
-
* @param endMinute
|
|
2667
|
-
* @returns
|
|
2668
|
-
*/
|
|
2669
|
-
static randomTime(time?: ConfigType, startHour?: number, startMinute?: number, endHour?: number, endMinute?: number): Time;
|
|
2670
|
-
/**
|
|
2671
|
-
* Get the first day of the month of the given date
|
|
2672
|
-
*
|
|
2673
|
-
* @param time
|
|
2674
|
-
*
|
|
2675
|
-
* @returns
|
|
2676
|
-
*/
|
|
2677
|
-
static firstDayOfMonth(time: ConfigType): Time;
|
|
2678
|
-
/**
|
|
2679
|
-
* Get the last day of the month of the given date
|
|
2680
|
-
*
|
|
2681
|
-
* @param time
|
|
2682
|
-
*
|
|
2683
|
-
* @returns
|
|
2684
|
-
*/
|
|
2685
|
-
static lastDayOfMonth(time: ConfigType): Time;
|
|
2686
|
-
}
|
|
2687
|
-
//#endregion
|
|
2688
2695
|
//#region src/GlobalBootstrap.d.ts
|
|
2689
2696
|
type CollapseStatics<T extends Record<string, any>> = { [K in keyof T]: T[K] };
|
|
2690
2697
|
type Omitables = 'start' | 'take' | 'reverse' | 'chunk' | 'find' | 'pop' | 'end' | 'shift' | 'push' | 'at' | 'prototype' | 'concat' | 'join' | 'slice' | 'sort' | 'splice' | 'includes' | 'indexOf' | 'lastIndexOf' | 'findIndex' | 'every' | 'some' | 'forEach' | 'map' | 'filter' | 'reduce' | 'unshift' | 'flat' | 'flatMap' | 'keys' | 'fill' | 'copyWithin' | 'entries' | 'values' | 'reduceRight' | 'length' | 'of' | typeof Symbol.unscopables | typeof Symbol.iterator;
|
|
2691
|
-
type TakeTime = Pick<typeof
|
|
2698
|
+
type TakeTime = Pick<typeof DateTime, 'now' | 'format' | 'fromTimestamp' | 'randomTime' | 'firstDayOfMonth' | 'lastDayOfMonth' | 'parse'>;
|
|
2692
2699
|
type TakeString = Pick<typeof Str, 'after' | 'afterLast' | 'apa' | 'ascii' | 'before' | 'beforeLast' | 'between' | 'betweenFirst' | 'capitalize' | 'plural' | 'singular' | 'title'>;
|
|
2693
2700
|
/**
|
|
2694
2701
|
* Global helpers interface that mirrors Laravel's helpers
|
|
@@ -2699,9 +2706,9 @@ interface GlobalHelpers extends Omit<CollapseStatics<typeof Arr_d_exports>, Omit
|
|
|
2699
2706
|
Str: typeof Str;
|
|
2700
2707
|
Obj: typeof Obj_d_exports;
|
|
2701
2708
|
Crypto: typeof Crypto_d_exports;
|
|
2702
|
-
Time: typeof Time;
|
|
2703
2709
|
Number: typeof Number_d_exports;
|
|
2704
2710
|
DumpDie: typeof DumpDie_d_exports;
|
|
2711
|
+
DateTime: typeof DateTime;
|
|
2705
2712
|
}
|
|
2706
2713
|
/**
|
|
2707
2714
|
* Bootstrap the global helpers into the global scope.
|
|
@@ -2734,5 +2741,5 @@ declare function loadHelpers(target?: any): void;
|
|
|
2734
2741
|
*/
|
|
2735
2742
|
declare function cleanHelpers(target?: any): void;
|
|
2736
2743
|
//#endregion
|
|
2737
|
-
export { Arr_d_exports as Arr, Callback, CamelToSnakeCase, Crypto_d_exports as Crypto, DumpDie_d_exports as DumpDie, ExcerptOptions, Fallback, Function, GlobalHelpers, HtmlString, HtmlStringType, KeysToSnakeCase, Mode, Number_d_exports as Number, Obj_d_exports as Obj, SnakeToCamelCase, SnakeToTitleCase, Str, Stringable, TGeneric,
|
|
2744
|
+
export { Arr_d_exports as Arr, Callback, CamelToSnakeCase, Crypto_d_exports as Crypto, DateTime, DumpDie_d_exports as DumpDie, ExcerptOptions, Fallback, Function, GlobalHelpers, HtmlString, HtmlStringType, KeysToSnakeCase, Mode, Number_d_exports as Number, Obj_d_exports as Obj, SnakeToCamelCase, SnakeToTitleCase, Str, Stringable, TGeneric, Value, XGeneric, abbreviate, alternate, base64Decode, base64Encode, caesarCipher, checksum, chunk, cleanHelpers, collapse, combine, dd, dot, dump, extractProperties, find, first, flatten, forget, format, getValue, hash, hmac, humanize, isEmpty, isNotEmpty, last, loadHelpers, modObj, pop, prepend, random, randomColor, randomPassword, randomSecure, range, reverse, safeDot, secureToken, setNested, shift, slugifyKeys, str, take, toBytes, toHumanTime, uuid, verifyChecksum, wrap, xor };
|
|
2738
2745
|
//# sourceMappingURL=index.d.ts.map
|