@h3ravel/support 0.14.4 → 0.14.5

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/index.cjs CHANGED
@@ -30,7 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
 
31
31
  //#endregion
32
32
  let crypto = require("crypto");
33
- crypto = __toESM(crypto);
34
33
  let process = require("process");
35
34
  process = __toESM(process);
36
35
  let util = require("util");
@@ -1559,6 +1558,15 @@ var DateTime = class DateTime extends TimeClass {
1559
1558
  return this.startOf(unit);
1560
1559
  }
1561
1560
  /**
1561
+ * Set the timezone for the instance
1562
+ *
1563
+ * @param timezone
1564
+ * @returns
1565
+ */
1566
+ setTimezone(timezone$1, keepLocalTime) {
1567
+ return new DateTime(this.tz(timezone$1, keepLocalTime));
1568
+ }
1569
+ /**
1562
1570
  * End time of a specific unit.
1563
1571
  *
1564
1572
  * @returns
@@ -1613,7 +1621,7 @@ var DateTime = class DateTime extends TimeClass {
1613
1621
  * @return {Date} object
1614
1622
  */
1615
1623
  static fromTimestamp(timestamp) {
1616
- return /* @__PURE__ */ new Date(timestamp * 1e3);
1624
+ return new DateTime(timestamp * 1e3);
1617
1625
  }
1618
1626
  /**
1619
1627
  * Get current time instance.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  /// <reference path="./app.globals.d.ts" />
2
- import { t as __export } from "./chunk-Bop6jNiL.js";
3
- import dayjs, { ConfigType, Dayjs, OpUnitType } from "dayjs";
2
+ import "node:module";
4
3
  import { DotFlatten, DotNestedKeys, DotNestedValue } from "@h3ravel/shared";
4
+ import dayjs, { ConfigType, Dayjs, OpUnitType } from "dayjs";
5
5
 
6
+ //#region rolldown:runtime
7
+ //#endregion
6
8
  //#region src/Contracts/StrContract.d.ts
7
9
  /**
8
10
  * Converts CamelCased strings to snake_case
@@ -33,10 +35,10 @@ interface Function {
33
35
  * Convert CamelCased Object keys to snake_case
34
36
  */
35
37
  type KeysToSnakeCase<T$1> = { [K in keyof T$1 as CamelToSnakeCase<string & K>]: T$1[K] };
36
- type TGeneric<V$1 = any, K$1 extends string = string> = Record<K$1, V$1>;
37
- type XGeneric<V$1 = TGeneric, T$1 = any> = {
38
+ type TGeneric<V = any, K$1 extends string = string> = Record<K$1, V>;
39
+ type XGeneric<V = TGeneric, T$1 = any> = {
38
40
  [key: string]: T$1;
39
- } & V$1;
41
+ } & V;
40
42
  type DotPath<T$1> = T$1 extends object ? { [K in keyof T$1 & (string | number)]: T$1[K] extends object ? `${K}` | `${K}.${DotPath<T$1[K]>}` : `${K}` }[keyof T$1 & (string | number)] : never;
41
43
  //#endregion
42
44
  //#region src/Contracts/TypeCast.d.ts
@@ -261,7 +263,7 @@ declare namespace Obj_d_exports {
261
263
  * @param obj - The nested object to flatten
262
264
  * @returns A flattened object with dotted keys and inferred types
263
265
  */
264
- declare const dot: <T extends Record<string, any>>(obj: T) => DotFlatten<T>;
266
+ declare const dot: <T$1 extends Record<string, any>>(obj: T$1) => DotFlatten<T$1>;
265
267
  /**
266
268
  * Extracts a subset of properties from an object.
267
269
  *
@@ -271,7 +273,7 @@ declare const dot: <T extends Record<string, any>>(obj: T) => DotFlatten<T>;
271
273
  * @param keys - Array of keys to extract
272
274
  * @returns A new object with only the specified keys
273
275
  */
274
- declare const extractProperties: <T extends object, K extends keyof T>(obj: T, keys?: readonly K[]) => Pick<T, K>;
276
+ declare const extractProperties: <T$1 extends object, K$1 extends keyof T$1>(obj: T$1, keys?: readonly K$1[]) => Pick<T$1, K$1>;
275
277
  /**
276
278
  * Safely retrieves a value from an object by key or nested keys.
277
279
  *
@@ -280,7 +282,7 @@ declare const extractProperties: <T extends object, K extends keyof T>(obj: T, k
280
282
  * @param item - The source object
281
283
  * @returns The found value as a string or the key itself if not found
282
284
  */
283
- declare const getValue: <T extends Record<string, any>>(key: string | [keyof T, keyof T[string]], item: T) => string;
285
+ declare const getValue: <T$1 extends Record<string, any>>(key: string | [keyof T$1, keyof T$1[string]], item: T$1) => string;
284
286
  /**
285
287
  * Maps over an object's entries and returns a new object
286
288
  * with transformed keys and/or values.
@@ -291,7 +293,7 @@ declare const getValue: <T extends Record<string, any>>(key: string | [keyof T,
291
293
  * @param callback - Function that receives [key, value] and returns [newKey, newValue]
292
294
  * @returns A new object with transformed entries
293
295
  */
294
- declare const modObj: <T extends object, R>(obj: T, callback: (_entry: [keyof T & string, T[keyof T]]) => [string, R]) => Record<string, R>;
296
+ declare const modObj: <T$1 extends object, R>(obj: T$1, callback: (_entry: [keyof T$1 & string, T$1[keyof T$1]]) => [string, R]) => Record<string, R>;
295
297
  declare function safeDot<T$1 extends Record<string, any>>(_data: T$1): T$1;
296
298
  declare function safeDot<T$1 extends Record<string, any>, K$1 extends DotNestedKeys<T$1>>(_data: T$1, _key?: K$1): DotNestedValue<T$1, K$1>;
297
299
  /**
@@ -317,7 +319,7 @@ declare const setNested: (obj: Record<string, any>, key: string, value: any) =>
317
319
  * @param separator - Separator for slugified keys (default: "_")
318
320
  * @returns A new object with slugified keys
319
321
  */
320
- declare const slugifyKeys: <T extends object>(obj: T, only?: string[], separator?: string) => KeysToSnakeCase<T>;
322
+ declare const slugifyKeys: <T$1 extends object>(obj: T$1, only?: string[], separator?: string) => KeysToSnakeCase<T$1>;
321
323
  /**
322
324
  * toCssClasses
323
325
  *
@@ -348,13 +350,13 @@ declare function undot(obj: Record<string, any>): Record<string, any>;
348
350
  *
349
351
  * Get a value from an object using dot notation.
350
352
  */
351
- declare function data_get<T$1 extends object, P$1 extends DotPath<T$1> | DotPath<T$1>[], D$1 = undefined>(obj: T$1, path: P$1, defaultValue?: D$1): T$1 | any;
353
+ declare function data_get<T$1 extends object, P extends DotPath<T$1> | DotPath<T$1>[], D = undefined>(obj: T$1, path: P, defaultValue?: D): T$1 | any;
352
354
  /**
353
355
  * data_set
354
356
  *
355
357
  * Set a value in an object using dot notation. Mutates the object.
356
358
  */
357
- declare function data_set<T$1 extends Record<string, any>, P$1 extends string | string[], V$1>(obj: T$1, path: P$1, value: V$1): asserts obj is T$1 & Record<P$1 extends string ? P$1 : P$1[0], V$1>;
359
+ declare function data_set<T$1 extends Record<string, any>, P extends string | string[], V>(obj: T$1, path: P, value: V): asserts obj is T$1 & Record<P extends string ? P : P[0], V>;
358
360
  /**
359
361
  * data_fill
360
362
  *
@@ -384,7 +386,7 @@ declare class Obj {
384
386
  *
385
387
  * Returns a new object (does not mutate original).
386
388
  */
387
- static add<T extends Record<string, any>, K extends string, V>(obj: T, key: K, value: V): T & Record<K, V>;
389
+ static add<T$1 extends Record<string, any>, K$1 extends string, V>(obj: T$1, key: K$1, value: V): T$1 & Record<K$1, V>;
388
390
  /**
389
391
  * Deeply merges two or more objects.
390
392
  * - Arrays are replaced (not concatenated)
@@ -394,26 +396,26 @@ declare class Obj {
394
396
  * @param objects
395
397
  * @returns
396
398
  */
397
- static deepMerge<T extends Record<string, any>>(...objects: (Partial<T> | undefined | null)[]): T;
399
+ static deepMerge<T$1 extends Record<string, any>>(...objects: (Partial<T$1> | undefined | null)[]): T$1;
398
400
  /**
399
401
  * Split object into [keys, values]
400
402
  */
401
- static divide<T extends Record<string, any>>(obj: T): [string[], any[]];
403
+ static divide<T$1 extends Record<string, any>>(obj: T$1): [string[], any[]];
402
404
  /**
403
405
  * Check if a key exists in the object.
404
406
  */
405
- static exists<T extends Record<string, any>>(obj: T, key: string | number): boolean;
407
+ static exists<T$1 extends Record<string, any>>(obj: T$1, key: string | number): boolean;
406
408
  /**
407
409
  * Get a value from an object using dot notation.
408
410
  *
409
411
  * Example:
410
412
  * Obj.get({a:{b:1}}, 'a.b') -> 1
411
413
  */
412
- static get<T extends object, P extends DotPath<T>, D = undefined>(obj: T, path: P, defaultValue?: D): any;
414
+ static get<T$1 extends object, P extends DotPath<T$1>, D = undefined>(obj: T$1, path: P, defaultValue?: D): any;
413
415
  /**
414
416
  * Check if the object has a given key or keys (dot notation supported).
415
417
  */
416
- static has<T extends object, P extends DotPath<T>>(obj: T, keys: P | P[]): boolean;
418
+ static has<T$1 extends object, P extends DotPath<T$1>>(obj: T$1, keys: P | P[]): boolean;
417
419
  /**
418
420
  * Check if an object is associative (has at least one non-numeric key).
419
421
  */
@@ -421,7 +423,7 @@ declare class Obj {
421
423
  /**
422
424
  * Add a prefix to all keys of the object.
423
425
  */
424
- static prependKeysWith<T extends Record<string, any>>(obj: T, prefix: string): Record<string, any>;
426
+ static prependKeysWith<T$1 extends Record<string, any>>(obj: T$1, prefix: string): Record<string, any>;
425
427
  /**
426
428
  * Convert an object into a URL query string.
427
429
  *
@@ -482,7 +484,7 @@ declare class Arr {
482
484
  * Arr.divide(['a','b']) -> [[0,1], ['a','b']]
483
485
  * Arr.divide({x:1,y:2}) -> [['x','y'], [1,2]]
484
486
  */
485
- static divide<A>(input: A[] | Record<string, A>): (number[] | A[])[] | (string[] | A[])[];
487
+ static divide<A>(input: A[] | Record<string, A>): (A[] | number[])[] | (A[] | string[])[];
486
488
  /**
487
489
  * Flatten a nested array/object structure into a single-level object
488
490
  * with dot-notated keys.
@@ -496,7 +498,7 @@ declare class Arr {
496
498
  /**
497
499
  * Checks if all elements satisfy the predicate
498
500
  */
499
- static every<T>(array: T[], predicate: (item: T) => boolean): boolean;
501
+ static every<T$1>(array: T$1[], predicate: (item: T$1) => boolean): boolean;
500
502
  /**
501
503
  * Remove items by keys/indices from an array or properties from an object.
502
504
  *
@@ -551,11 +553,11 @@ declare class Arr {
551
553
  * Converts various input types into a plain array
552
554
  * Supports Arrays, Objects, Iterables, Map, WeakMap, and custom toArray/toJSON/jsonSerialize methods
553
555
  */
554
- static from<T>(value: T | Iterable<T> | Arrayable | Jsonable | JsonSerializable | null | undefined): any[];
556
+ static from<T$1>(value: T$1 | Iterable<T$1> | Arrayable | Jsonable | JsonSerializable | null | undefined): any[];
555
557
  /**
556
558
  * Checks if an object has all the specified keys
557
559
  */
558
- static hasAll<T extends object>(obj: T, keys: (keyof T)[]): boolean;
560
+ static hasAll<T$1 extends object>(obj: T$1, keys: (keyof T$1)[]): boolean;
559
561
  /**
560
562
  * For arrays: check if the array contains any of the provided values.
561
563
  *
@@ -592,7 +594,7 @@ declare class Arr {
592
594
  * Example:
593
595
  * Arr.keyBy([{id:1},{id:2}], 'id') -> { '1': {id:1}, '2': {id:2} }
594
596
  */
595
- static keyBy<T>(array: T[], key: keyof T | ((item: T) => string | number)): Record<string, T>;
597
+ static keyBy<T$1>(array: T$1[], key: keyof T$1 | ((item: T$1) => string | number)): Record<string, T$1>;
596
598
  /**
597
599
  * Get the last element of an array, optionally matching a predicate,
598
600
  * or the last element if no predicate is provided, otherwise the defaultValue.
@@ -607,15 +609,15 @@ declare class Arr {
607
609
  *
608
610
  * @returns
609
611
  */
610
- static last<T, P extends ((item: T) => boolean) | true>(array: T[], predicate?: P | T, defaultValue?: T): P extends true ? [T, T[]] : T | undefined;
612
+ static last<T$1, P extends ((item: T$1) => boolean) | true>(array: T$1[], predicate?: P | T$1, defaultValue?: T$1): P extends true ? [T$1, T$1[]] : T$1 | undefined;
611
613
  /**
612
614
  * Transform each element in an array using a callback.
613
615
  */
614
- static map<T, U>(array: T[], callback: (item: T, index: number) => U): U[];
616
+ static map<T$1, U$1>(array: T$1[], callback: (item: T$1, index: number) => U$1): U$1[];
615
617
  /**
616
618
  * Maps a multi-dimensional array with a spread callback
617
619
  */
618
- static mapSpread<T extends any[], U>(array: T[], callback: (...items: T) => U): U[];
620
+ static mapSpread<T$1 extends any[], U$1>(array: T$1[], callback: (...items: T$1) => U$1): U$1[];
619
621
  /**
620
622
  * Map each element to a key-value pair.
621
623
  *
@@ -623,25 +625,25 @@ declare class Arr {
623
625
  * Arr.mapWithKeys([{id:1, name:'A'}], x => [x.id, x.name])
624
626
  * -> { '1': 'A' }
625
627
  */
626
- static mapWithKeys<T, K extends string | number, V>(array: T[], callback: (item: T, index: number) => [K, V]): Record<string, V>;
628
+ static mapWithKeys<T$1, K$1 extends string | number, V>(array: T$1[], callback: (item: T$1, index: number) => [K$1, V]): Record<string, V>;
627
629
  /**
628
630
  * Return only elements at the given indices.
629
631
  *
630
632
  * Example:
631
633
  * Arr.only([10,20,30], [0,2]) -> [10,30]
632
634
  */
633
- static only<T>(array: T[], keys: number | number[]): T[];
635
+ static only<T$1>(array: T$1[], keys: number | number[]): T$1[];
634
636
  /**
635
637
  * Split an array into two arrays based on a predicate
636
638
  */
637
- static partition<T>(array: T[], predicate: (item: T) => boolean): [T[], T[]];
639
+ static partition<T$1>(array: T$1[], predicate: (item: T$1) => boolean): [T$1[], T$1[]];
638
640
  /**
639
641
  * Extract a property from each element in an array of objects.
640
642
  *
641
643
  * Example:
642
644
  * Arr.pluck([{name:'A'},{name:'B'}], 'name') -> ['A','B']
643
645
  */
644
- static pluck<T, K extends keyof T>(array: T[], key: K): T[K][];
646
+ static pluck<T$1, K$1 extends keyof T$1>(array: T$1[], key: K$1): T$1[K$1][];
645
647
  /**
646
648
  * Add elements to the beginning of an array and return a new array.
647
649
  *
@@ -649,56 +651,56 @@ declare class Arr {
649
651
  * @param value
650
652
  * @returns
651
653
  */
652
- static prepend<T>(array: T[], ...value: T[]): T[];
654
+ static prepend<T$1>(array: T$1[], ...value: T$1[]): T$1[];
653
655
  /**
654
656
  * Remove a value from an array by index and return it.
655
657
  * Returns a tuple: [newArray, removedValue]
656
658
  */
657
- static pull<T>(array: T[], key: number): [T[], T | undefined];
659
+ static pull<T$1>(array: T$1[], key: number): [T$1[], T$1 | undefined];
658
660
  /**
659
661
  * Append values to an array (mutable)
660
662
  */
661
- static push<T>(array: T[], ...values: T[]): T[];
663
+ static push<T$1>(array: T$1[], ...values: T$1[]): T$1[];
662
664
  /**
663
665
  * Pick one or more random elements from an array.
664
666
  */
665
- static random<T>(array: T[], count?: number): T | T[] | undefined;
667
+ static random<T$1>(array: T$1[], count?: number): T$1 | T$1[] | undefined;
666
668
  /**
667
669
  * Returns array elements that do NOT satisfy the predicate
668
670
  */
669
- static reject<T>(array: T[], predicate: (item: T) => boolean): T[];
671
+ static reject<T$1>(array: T$1[], predicate: (item: T$1) => boolean): T$1[];
670
672
  /**
671
673
  * Pick keys from an array of objects or an object
672
674
  */
673
- static select<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
675
+ static select<T$1 extends object, K$1 extends keyof T$1>(obj: T$1, keys: K$1[]): Pick<T$1, K$1>;
674
676
  /**
675
677
  * Returns the only element that passes a callback, throws if none or multiple
676
678
  */
677
- static sole<T>(array: T[], predicate: (item: T) => boolean): T;
679
+ static sole<T$1>(array: T$1[], predicate: (item: T$1) => boolean): T$1;
678
680
  /**
679
681
  * Checks if at least one element satisfies the predicate
680
682
  */
681
- static some<T>(array: T[], predicate: (item: T) => boolean): boolean;
683
+ static some<T$1>(array: T$1[], predicate: (item: T$1) => boolean): boolean;
682
684
  /**
683
685
  * Randomly shuffle an array and return a new array.
684
686
  */
685
- static shuffle<T>(array: T[]): T[];
687
+ static shuffle<T$1>(array: T$1[]): T$1[];
686
688
  /**
687
689
  * Sort an array ascending using optional comparator.
688
690
  */
689
- static sort<T>(array: T[], comparator?: (a: T, b: T) => number): T[];
691
+ static sort<T$1>(array: T$1[], comparator?: (a: T$1, b: T$1) => number): T$1[];
690
692
  /**
691
693
  * Sort an array descending using optional comparator.
692
694
  */
693
- static sortDesc<T>(array: T[], comparator?: (a: T, b: T) => number): T[];
695
+ static sortDesc<T$1>(array: T$1[], comparator?: (a: T$1, b: T$1) => number): T$1[];
694
696
  /**
695
697
  * Recursively sort arrays inside an array.
696
698
  */
697
- static sortRecursive<T>(array: T[]): T[];
699
+ static sortRecursive<T$1>(array: T$1[]): T$1[];
698
700
  /**
699
701
  * Recursively sort arrays inside an array descending.
700
702
  */
701
- static sortRecursiveDesc<T>(array: T[]): T[];
703
+ static sortRecursiveDesc<T$1>(array: T$1[]): T$1[];
702
704
  /**
703
705
  * Retrieve a value using dot notation
704
706
  * Throws if value is not a string
@@ -711,15 +713,15 @@ declare class Arr {
711
713
  * @param count
712
714
  * @returns
713
715
  */
714
- static take<T>(array: T[], count: number): T[];
716
+ static take<T$1>(array: T$1[], count: number): T$1[];
715
717
  /**
716
718
  * Filter an array based on a predicate function or key-value match.
717
719
  */
718
- static where<T>(array: T[], predicate: ((item: T) => boolean) | Partial<T>): T[];
720
+ static where<T$1>(array: T$1[], predicate: ((item: T$1) => boolean) | Partial<T$1>): T$1[];
719
721
  /**
720
722
  * Filter an array of objects, keeping elements where the given key is not null/undefined.
721
723
  */
722
- static whereNotNull<T>(array: T[], key: keyof T): T[];
724
+ static whereNotNull<T$1>(array: T$1[], key: keyof T$1): T$1[];
723
725
  /**
724
726
  * If the given value is not an array and not null, wrap it in one.
725
727
  *
@@ -728,11 +730,11 @@ declare class Arr {
728
730
  * @param value
729
731
  * @returns
730
732
  */
731
- static wrap<T>(value: T | T[] | null | undefined): T[];
733
+ static wrap<T$1>(value: T$1 | T$1[] | null | undefined): T$1[];
732
734
  /**
733
735
  * Return the first element of an array, undefined if empty.
734
736
  */
735
- static head<T>(array: T[]): T | undefined;
737
+ static head<T$1>(array: T$1[]): T$1 | undefined;
736
738
  /**
737
739
  * Splits an array into chunks of a specified size.
738
740
  *
@@ -741,7 +743,7 @@ declare class Arr {
741
743
  * @param size - Size of each chunk (default: 2)
742
744
  * @returns An array of chunks (arrays)
743
745
  */
744
- static chunk: <T>(arr: T[], size?: number) => T[][];
746
+ static chunk: <T$1>(arr: T$1[], size?: number) => T$1[][];
745
747
  /**
746
748
  * Alternates between two arrays, creating a zipped result.
747
749
  *
@@ -749,7 +751,7 @@ declare class Arr {
749
751
  * @param b
750
752
  * @returns
751
753
  */
752
- static alternate<T>(a: T[], b: T[]): T[];
754
+ static alternate<T$1>(a: T$1[], b: T$1[]): T$1[];
753
755
  /**
754
756
  * Combine arrays and sum their values element by element.
755
757
  *
@@ -764,35 +766,35 @@ declare class Arr {
764
766
  * @param arr
765
767
  * @returns
766
768
  */
767
- static find<T>(key: T, arr: T[]): T | null;
769
+ static find<T$1>(key: T$1, arr: T$1[]): T$1 | null;
768
770
  /**
769
771
  * Check if array is empty.
770
772
  *
771
773
  * @param arr
772
774
  * @returns
773
775
  */
774
- static isEmpty<T>(arr: T[]): boolean;
776
+ static isEmpty<T$1>(arr: T$1[]): boolean;
775
777
  /**
776
778
  * Check if array is empty.
777
779
  *
778
780
  * @param arr
779
781
  * @returns
780
782
  */
781
- static isNotEmpty<T>(arr: T[]): boolean;
783
+ static isNotEmpty<T$1>(arr: T$1[]): boolean;
782
784
  /**
783
785
  * Pop the element off the end of array.
784
786
  *
785
787
  * @param arr
786
788
  * @returns
787
789
  */
788
- static pop<T>(arr: T[]): T[];
790
+ static pop<T$1>(arr: T$1[]): T$1[];
789
791
  /**
790
792
  * Create a new array in reverse order.
791
793
  *
792
794
  * @param arr
793
795
  * @returns
794
796
  */
795
- static reverse<T>(arr: T[]): T[];
797
+ static reverse<T$1>(arr: T$1[]): T$1[];
796
798
  /**
797
799
  * Return the first element of an array that satisfies the predicate,
798
800
  * or the first element if no predicate is provided, otherwise the defaultValue.
@@ -833,6 +835,13 @@ declare class DateTime extends TimeClass {
833
835
  * @returns
834
836
  */
835
837
  start(unit?: OpUnitType): dayjs.Dayjs;
838
+ /**
839
+ * Set the timezone for the instance
840
+ *
841
+ * @param timezone
842
+ * @returns
843
+ */
844
+ setTimezone(timezone?: string | undefined, keepLocalTime?: boolean | undefined): DateTime;
836
845
  /**
837
846
  * End time of a specific unit.
838
847
  *
@@ -869,7 +878,7 @@ declare class DateTime extends TimeClass {
869
878
  *
870
879
  * @return {Date} object
871
880
  */
872
- static fromTimestamp(timestamp: number): Date;
881
+ static fromTimestamp(timestamp: number): DateTime;
873
882
  /**
874
883
  * Get current time instance.
875
884
  *
package/dist/index.js CHANGED
@@ -1517,6 +1517,15 @@ var DateTime = class DateTime extends TimeClass {
1517
1517
  return this.startOf(unit);
1518
1518
  }
1519
1519
  /**
1520
+ * Set the timezone for the instance
1521
+ *
1522
+ * @param timezone
1523
+ * @returns
1524
+ */
1525
+ setTimezone(timezone$1, keepLocalTime) {
1526
+ return new DateTime(this.tz(timezone$1, keepLocalTime));
1527
+ }
1528
+ /**
1520
1529
  * End time of a specific unit.
1521
1530
  *
1522
1531
  * @returns
@@ -1571,7 +1580,7 @@ var DateTime = class DateTime extends TimeClass {
1571
1580
  * @return {Date} object
1572
1581
  */
1573
1582
  static fromTimestamp(timestamp) {
1574
- return /* @__PURE__ */ new Date(timestamp * 1e3);
1583
+ return new DateTime(timestamp * 1e3);
1575
1584
  }
1576
1585
  /**
1577
1586
  * Get current time instance.
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@h3ravel/support",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "Shared helpers, facades and utilities for H3ravel.",
5
5
  "type": "module",
6
- "main": "./dist/index.js",
6
+ "main": "./dist/index.cjs",
7
7
  "types": "./dist/index.d.ts",
8
8
  "module": "./dist/index.js",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./dist/index.d.ts",
12
11
  "import": "./dist/index.js",
13
12
  "require": "./dist/index.cjs"
14
- }
13
+ },
14
+ "./*": "./*"
15
15
  },
16
16
  "files": [
17
17
  "dist"
@@ -38,7 +38,7 @@
38
38
  "devDependencies": {
39
39
  "@types/luxon": "^3.7.1",
40
40
  "typescript": "^5.4.0",
41
- "@h3ravel/shared": "^0.25.0"
41
+ "@h3ravel/shared": "^0.26.1"
42
42
  },
43
43
  "dependencies": {
44
44
  "dayjs": "^1.11.18",