@zelgadis87/utils-core 4.4.4 → 4.6.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.
Files changed (68) hide show
  1. package/esbuild/index.cjs +207 -270
  2. package/esbuild/{index.mjs → index.js} +197 -282
  3. package/esbuild/package.json +39 -0
  4. package/package.json +14 -102
  5. package/src/async/Semaphore.ts +8 -6
  6. package/src/time/TimeDuration.ts +22 -11
  7. package/src/time/TimeInstant.ts +38 -21
  8. package/src/utils/arrays/groupBy.ts +11 -11
  9. package/src/utils/arrays.ts +9 -3
  10. package/src/utils/functions/constant.ts +2 -0
  11. package/src/utils/functions.ts +23 -0
  12. package/src/utils/random.ts +9 -3
  13. package/src/utils/records.ts +12 -0
  14. package/dist/Logger.d.ts +0 -21
  15. package/dist/Optional.d.ts +0 -70
  16. package/dist/async/CancelableDeferred.d.ts +0 -17
  17. package/dist/async/Deferred.d.ts +0 -34
  18. package/dist/async/RateThrottler.d.ts +0 -13
  19. package/dist/async/Semaphore.d.ts +0 -14
  20. package/dist/async/index.d.ts +0 -4
  21. package/dist/index.d.ts +0 -8
  22. package/dist/lazy/Lazy.d.ts +0 -22
  23. package/dist/lazy/LazyAsync.d.ts +0 -24
  24. package/dist/lazy/index.d.ts +0 -2
  25. package/dist/sorting/ComparisonChain.d.ts +0 -57
  26. package/dist/sorting/Sorter.d.ts +0 -100
  27. package/dist/sorting/index.d.ts +0 -4
  28. package/dist/sorting/types.d.ts +0 -5
  29. package/dist/time/RandomTimeDuration.d.ts +0 -9
  30. package/dist/time/TimeBase.d.ts +0 -38
  31. package/dist/time/TimeDuration.d.ts +0 -79
  32. package/dist/time/TimeFrequency.d.ts +0 -10
  33. package/dist/time/TimeInstant.d.ts +0 -171
  34. package/dist/time/TimeInstantBuilder.d.ts +0 -77
  35. package/dist/time/TimeRange.d.ts +0 -11
  36. package/dist/time/TimeUnit.d.ts +0 -17
  37. package/dist/time/index.d.ts +0 -7
  38. package/dist/time/types.d.ts +0 -26
  39. package/dist/tsconfig.tsbuildinfo +0 -1
  40. package/dist/upgrade/DataUpgrader.d.ts +0 -22
  41. package/dist/upgrade/errors.d.ts +0 -12
  42. package/dist/upgrade/getTransitionsPath.d.ts +0 -3
  43. package/dist/upgrade/index.d.ts +0 -2
  44. package/dist/upgrade/types.d.ts +0 -31
  45. package/dist/utils/arrays/groupBy.d.ts +0 -9
  46. package/dist/utils/arrays/indexBy.d.ts +0 -7
  47. package/dist/utils/arrays/statistics.d.ts +0 -8
  48. package/dist/utils/arrays/uniqBy.d.ts +0 -4
  49. package/dist/utils/arrays.d.ts +0 -56
  50. package/dist/utils/booleans.d.ts +0 -2
  51. package/dist/utils/empties.d.ts +0 -17
  52. package/dist/utils/errors/withTryCatch.d.ts +0 -3
  53. package/dist/utils/errors.d.ts +0 -3
  54. package/dist/utils/functions/constant.d.ts +0 -8
  55. package/dist/utils/functions/iff.d.ts +0 -8
  56. package/dist/utils/functions.d.ts +0 -27
  57. package/dist/utils/index.d.ts +0 -13
  58. package/dist/utils/json.d.ts +0 -11
  59. package/dist/utils/nulls.d.ts +0 -8
  60. package/dist/utils/numbers/round.d.ts +0 -8
  61. package/dist/utils/numbers.d.ts +0 -34
  62. package/dist/utils/primitives.d.ts +0 -3
  63. package/dist/utils/promises.d.ts +0 -6
  64. package/dist/utils/random.d.ts +0 -2
  65. package/dist/utils/records/entries.d.ts +0 -4
  66. package/dist/utils/records.d.ts +0 -21
  67. package/dist/utils/strings/StringParts.d.ts +0 -32
  68. package/dist/utils/strings.d.ts +0 -17
@@ -1,21 +0,0 @@
1
- export * from './records/entries.js';
2
- export type TEmpty = Record<string, never>;
3
- export type TKeysOfType<T, V> = {
4
- [K in keyof T]-?: T[K] extends V ? K : never;
5
- }[keyof T];
6
- export declare function dictToList<T>(obj: Record<string | number, T>): T[];
7
- export declare function pick<T extends object, K extends keyof T>(o: T, keys: K[]): Pick<T, K>;
8
- export type TOptionsWithoutDefaults<T, R> = Partial<T> & Required<Omit<T, keyof R>>;
9
- export type TOptionalKeysForType<T> = {
10
- [K in keyof T]-?: {} extends Pick<T, K> ? K : never;
11
- }[keyof T];
12
- export type TRequiredKeysForType<T> = Exclude<keyof T, TOptionalKeysForType<T>>;
13
- export type TAllKeysOptional<T> = TRequiredKeysForType<T> extends never ? true : false;
14
- export type TConditionalParameter<T> = TAllKeysOptional<T> extends true ? T | undefined : T;
15
- export type TConditionalParameterOptions<T, R> = TConditionalParameter<TOptionsWithoutDefaults<T, R>>;
16
- /**
17
- * Given a type T, replaces all fields of type From to fields of type To.
18
- */
19
- export type TReplaceType<T, From, To> = {
20
- [K in keyof T]: T[K] extends From ? To : T[K];
21
- };
@@ -1,32 +0,0 @@
1
- import { TReadableArray } from "../arrays.js";
2
- import { TMaybe } from "../nulls.js";
3
- export declare class StringParts {
4
- private readonly _parts;
5
- private constructor();
6
- toUpperCase(): StringParts;
7
- toLowerCase(): StringParts;
8
- capitalizeFirst(): StringParts;
9
- capitalizeEach(): StringParts;
10
- get parts(): string[];
11
- get tail(): string[];
12
- get first(): TMaybe<string>;
13
- get last(): TMaybe<string>;
14
- get length(): number;
15
- trim(): StringParts;
16
- toSnakeCase(): string;
17
- toCamelCase(): string;
18
- toKebabCase(): string;
19
- toPascalCase(): string;
20
- toHumanCase(): string;
21
- join(separator: string): string;
22
- mergeWith({ parts: otherParts }: {
23
- parts: TReadableArray<string>;
24
- }): StringParts;
25
- slice(start: number, end?: number): StringParts;
26
- splice(start: number, deleteCount: number, ...items: string[]): StringParts;
27
- push(part: string): StringParts;
28
- shift(part: string): StringParts;
29
- reverse(): StringParts;
30
- static fromString: (s: string, separator?: string | RegExp) => StringParts;
31
- static fromParts: (...parts: string[]) => StringParts;
32
- }
@@ -1,17 +0,0 @@
1
- export * from './strings/StringParts.js';
2
- export type THtmlString = string;
3
- export type TUrl = string;
4
- export type TRelativeUrl = string;
5
- export declare function hashCode(str: string): number;
6
- export declare function repeat(char: string, times: number): string;
7
- export declare function capitalizeWord(word: string): string;
8
- export declare function splitWords(text: string, regEx?: RegExp): string[];
9
- export declare function stringToNumber(s: string | null | undefined): number | null;
10
- export declare function pad(str: string, n: number, char: string, where?: 'left' | 'right'): string;
11
- export declare function padLeft(str: string, n: number, char: string): string;
12
- export declare function padRight(str: string, n: number, char: string): string;
13
- export declare function ellipsis(str: string, maxLength: number): string;
14
- export declare function pluralize(n: number, singular: string, plural?: string): string;
15
- export declare function wrapWithString(str: string, delimiter: string): string;
16
- /** @deprecated[2024-12-23]: Use {@link wrapWithString} instead. */
17
- export declare const wrap: typeof wrapWithString;