@md-oss/common 0.1.6 → 0.1.7

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 (129) hide show
  1. package/dist/arrays-6DA6GfsQ.mjs +2 -0
  2. package/dist/arrays-6DA6GfsQ.mjs.map +1 -0
  3. package/dist/arrays-DvPJ1GeR.d.cts +163 -0
  4. package/dist/arrays-DvPJ1GeR.d.mts +163 -0
  5. package/dist/arrays-bgbansWs.cjs +2 -0
  6. package/dist/arrays-bgbansWs.cjs.map +1 -0
  7. package/dist/constants/bytes.cjs +1 -1
  8. package/dist/constants/bytes.cjs.map +1 -1
  9. package/dist/constants/bytes.d.cts +31 -1
  10. package/dist/constants/bytes.d.mts +31 -1
  11. package/dist/constants/bytes.mjs +1 -1
  12. package/dist/constants/bytes.mjs.map +1 -1
  13. package/dist/files-DzKYei0a.mjs +2 -0
  14. package/dist/files-DzKYei0a.mjs.map +1 -0
  15. package/dist/files-m1nnj5gT.cjs +2 -0
  16. package/dist/files-m1nnj5gT.cjs.map +1 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.d.cts +10 -8
  19. package/dist/index.d.mts +10 -8
  20. package/dist/index.mjs +1 -1
  21. package/dist/mime-types-BmvBrrZ7.cjs.map +1 -1
  22. package/dist/mime-types-D_K53zgk.mjs.map +1 -1
  23. package/dist/{mime-types-Bjt4NvnE.d.cts → mime-types-Dajfhq2c.d.cts} +58 -1
  24. package/dist/{mime-types-Bjt4NvnE.d.mts → mime-types-Dajfhq2c.d.mts} +58 -1
  25. package/dist/numbers-B_mptknO.cjs +2 -0
  26. package/dist/numbers-B_mptknO.cjs.map +1 -0
  27. package/dist/numbers-C2680fmA.d.cts +184 -0
  28. package/dist/numbers-C2680fmA.d.mts +184 -0
  29. package/dist/numbers-lJ6gwIpk.mjs +2 -0
  30. package/dist/numbers-lJ6gwIpk.mjs.map +1 -0
  31. package/dist/objects-VXf3mqE5.mjs +2 -0
  32. package/dist/objects-VXf3mqE5.mjs.map +1 -0
  33. package/dist/objects-fiFExjsf.d.cts +116 -0
  34. package/dist/objects-fiFExjsf.d.mts +116 -0
  35. package/dist/objects-wcO6hNA8.cjs +2 -0
  36. package/dist/objects-wcO6hNA8.cjs.map +1 -0
  37. package/dist/random-668tofPV.cjs +2 -0
  38. package/dist/random-668tofPV.cjs.map +1 -0
  39. package/dist/random-BqJDZAPb.d.cts +131 -0
  40. package/dist/random-BqJDZAPb.d.mts +131 -0
  41. package/dist/random-ihslkInn.mjs +2 -0
  42. package/dist/random-ihslkInn.mjs.map +1 -0
  43. package/dist/runtime-7fkN5_oL.d.cts +206 -0
  44. package/dist/runtime-7fkN5_oL.d.mts +206 -0
  45. package/dist/runtime-Bfs-yn_-.cjs +2 -0
  46. package/dist/runtime-Bfs-yn_-.cjs.map +1 -0
  47. package/dist/runtime-CE36Va0l.mjs +2 -0
  48. package/dist/runtime-CE36Va0l.mjs.map +1 -0
  49. package/dist/strings-CrzGdnZH.mjs +3 -0
  50. package/dist/strings-CrzGdnZH.mjs.map +1 -0
  51. package/dist/strings-_1vAPvzS.cjs +3 -0
  52. package/dist/strings-_1vAPvzS.cjs.map +1 -0
  53. package/dist/strings-jE1j-qqa.d.cts +213 -0
  54. package/dist/strings-jE1j-qqa.d.mts +213 -0
  55. package/dist/time-BrLHgSth.d.mts +68 -0
  56. package/dist/time-DmJNWZeL.mjs.map +1 -1
  57. package/dist/time-ufhllID1.d.cts +68 -0
  58. package/dist/time-yNkQSJnQ.cjs.map +1 -1
  59. package/dist/utils/arrays.cjs +1 -1
  60. package/dist/utils/arrays.d.cts +1 -1
  61. package/dist/utils/arrays.d.mts +1 -1
  62. package/dist/utils/arrays.mjs +1 -1
  63. package/dist/utils/index.cjs +1 -1
  64. package/dist/utils/index.d.cts +187 -8
  65. package/dist/utils/index.d.mts +187 -8
  66. package/dist/utils/index.mjs +1 -1
  67. package/dist/utils/mime-types.d.cts +1 -1
  68. package/dist/utils/mime-types.d.mts +1 -1
  69. package/dist/utils/numbers.cjs +1 -1
  70. package/dist/utils/numbers.d.cts +1 -1
  71. package/dist/utils/numbers.d.mts +1 -1
  72. package/dist/utils/numbers.mjs +1 -1
  73. package/dist/utils/objects.cjs +1 -1
  74. package/dist/utils/objects.d.cts +1 -1
  75. package/dist/utils/objects.d.mts +1 -1
  76. package/dist/utils/objects.mjs +1 -1
  77. package/dist/utils/random.cjs +1 -1
  78. package/dist/utils/random.d.cts +1 -1
  79. package/dist/utils/random.d.mts +1 -1
  80. package/dist/utils/random.mjs +1 -1
  81. package/dist/utils/runtime.cjs +1 -1
  82. package/dist/utils/runtime.d.cts +1 -1
  83. package/dist/utils/runtime.d.mts +1 -1
  84. package/dist/utils/runtime.mjs +1 -1
  85. package/dist/utils/strings.cjs +1 -1
  86. package/dist/utils/strings.d.cts +1 -1
  87. package/dist/utils/strings.d.mts +1 -1
  88. package/dist/utils/strings.mjs +1 -1
  89. package/dist/utils/time.d.cts +1 -1
  90. package/dist/utils/time.d.mts +1 -1
  91. package/package.json +2 -2
  92. package/dist/arrays-BkHBzTDO.mjs +0 -2
  93. package/dist/arrays-BkHBzTDO.mjs.map +0 -1
  94. package/dist/arrays-CElcW69H.d.cts +0 -43
  95. package/dist/arrays-CElcW69H.d.mts +0 -43
  96. package/dist/arrays-DaB1Xn47.cjs +0 -2
  97. package/dist/arrays-DaB1Xn47.cjs.map +0 -1
  98. package/dist/numbers-CtAqd3eH.d.cts +0 -49
  99. package/dist/numbers-CtAqd3eH.d.mts +0 -49
  100. package/dist/numbers-D2K-8sJL.mjs +0 -2
  101. package/dist/numbers-D2K-8sJL.mjs.map +0 -1
  102. package/dist/numbers-Du__2-8Y.cjs +0 -2
  103. package/dist/numbers-Du__2-8Y.cjs.map +0 -1
  104. package/dist/objects--cO_X3EV.mjs +0 -2
  105. package/dist/objects--cO_X3EV.mjs.map +0 -1
  106. package/dist/objects-CnGoVkh6.cjs +0 -2
  107. package/dist/objects-CnGoVkh6.cjs.map +0 -1
  108. package/dist/objects-cf8j7rS8.d.cts +0 -26
  109. package/dist/objects-cf8j7rS8.d.mts +0 -26
  110. package/dist/random-D1e1NTOt.cjs +0 -2
  111. package/dist/random-D1e1NTOt.cjs.map +0 -1
  112. package/dist/random-DbidGSrQ.mjs +0 -2
  113. package/dist/random-DbidGSrQ.mjs.map +0 -1
  114. package/dist/random-DpNyGGAZ.d.cts +0 -28
  115. package/dist/random-DpNyGGAZ.d.mts +0 -28
  116. package/dist/runtime-DY-8W6Jr.mjs +0 -2
  117. package/dist/runtime-DY-8W6Jr.mjs.map +0 -1
  118. package/dist/runtime-T8Kcf7Af.d.cts +0 -28
  119. package/dist/runtime-T8Kcf7Af.d.mts +0 -28
  120. package/dist/runtime-peVFcWot.cjs +0 -2
  121. package/dist/runtime-peVFcWot.cjs.map +0 -1
  122. package/dist/strings-B0BRwNX9.mjs +0 -3
  123. package/dist/strings-B0BRwNX9.mjs.map +0 -1
  124. package/dist/strings-DV446vv-.cjs +0 -3
  125. package/dist/strings-DV446vv-.cjs.map +0 -1
  126. package/dist/strings-DhPbrpq7.d.cts +0 -47
  127. package/dist/strings-DhPbrpq7.d.mts +0 -47
  128. package/dist/time-8KLG8kBO.d.cts +0 -29
  129. package/dist/time-D8Wfqzu6.d.mts +0 -29
@@ -0,0 +1,213 @@
1
+ type StringifyArrayOptions<T> = {
2
+ maxItems: number;
3
+ maxItemLength?: number;
4
+ maxTotalLength?: number;
5
+ stringify: (item: T) => string;
6
+ prefix?: string;
7
+ suffix?: string;
8
+ joinString?: string;
9
+ };
10
+ /**
11
+ * Truncate a string to a maximum length, adding a suffix if truncated
12
+ * @param input - String to truncate
13
+ * @param length - Maximum length
14
+ * @param suffix - Suffix to add (default: "...")
15
+ * @returns Truncated string
16
+ * @example truncate("Hello World", 8) // "Hello..."
17
+ */
18
+ declare const truncate: (input: string, length: number, suffix?: string) => string;
19
+ /**
20
+ * Capitalize the first letter of a string
21
+ * @param input - String to capitalize
22
+ * @returns Capitalized string
23
+ * @example capitalize("hello world") // "Hello world"
24
+ */
25
+ declare const capitalize: (input: string) => string;
26
+ /**
27
+ * Capitalize the first letter of each word
28
+ * @param input - String to capitalize
29
+ * @returns String with each word capitalized
30
+ * @example capitalizeWords("hello world") // "Hello World"
31
+ */
32
+ declare const capitalizeWords: (input: string) => string;
33
+ /**
34
+ * Create a URL-friendly slug from a string
35
+ * @param input - String to slugify
36
+ * @returns Slugified string
37
+ * @example slugify("Hello World!") // "hello-world"
38
+ */
39
+ declare const slugify: (input: string) => string;
40
+ /**
41
+ * Escape HTML special characters
42
+ * @param input - String to escape
43
+ * @returns Escaped string
44
+ * @example escapeHtml("<div>Hello</div>") // "&lt;div&gt;Hello&lt;/div&gt;"
45
+ */
46
+ declare const escapeHtml: (input: string) => string;
47
+ /**
48
+ * Unescape HTML entities
49
+ * @param input - String to unescape
50
+ * @returns Unescaped string
51
+ * @example unescapeHtml("&lt;div&gt;") // "<div>"
52
+ */
53
+ declare const unescapeHtml: (input: string) => string;
54
+ /**
55
+ * Reverse a string
56
+ * @param input - String to reverse
57
+ * @returns Reversed string
58
+ * @example reverse("hello") // "olleh"
59
+ */
60
+ declare const reverse: (input: string) => string;
61
+ /**
62
+ * Count occurrences of a substring
63
+ * @param input - String to search in
64
+ * @param search - Substring to count
65
+ * @param caseSensitive - Whether to be case sensitive (default: true)
66
+ * @returns Number of occurrences
67
+ * @example countOccurrences("hello hello world", "hello") // 2
68
+ */
69
+ declare const countOccurrences: (input: string, search: string, caseSensitive?: boolean) => number;
70
+ /**
71
+ * Check if a string contains only letters
72
+ * @param input - String to check
73
+ * @returns True if only letters
74
+ * @example isAlpha("hello") // true, isAlpha("hello123") // false
75
+ */
76
+ declare const isAlpha: (input: string) => boolean;
77
+ /**
78
+ * Check if a string contains only alphanumeric characters
79
+ * @param input - String to check
80
+ * @returns True if alphanumeric
81
+ * @example isAlphanumeric("hello123") // true, isAlphanumeric("hello-123") // false
82
+ */
83
+ declare const isAlphanumeric: (input: string) => boolean;
84
+ /**
85
+ * Pad a string to a certain length with a character
86
+ * @param input - String to pad
87
+ * @param length - Target length
88
+ * @param char - Character to pad with (default: " ")
89
+ * @param direction - Direction to pad ("left", "right", or "both")
90
+ * @returns Padded string
91
+ * @example pad("hello", 10, "*", "right") // "hello*****"
92
+ */
93
+ declare const pad: (input: string, length: number, char?: string, direction?: "left" | "right" | "both") => string;
94
+ /**
95
+ * Stringify an array with various formatting options
96
+ * @param arr - Array to stringify
97
+ * @param options - Formatting options (max items, max length, etc.)
98
+ * @returns Object with result string and truncation info
99
+ * @example stringifyArray([1, 2, 3], {maxItems: 2, stringify: String}) // {result: "1, 2", truncatedItems: 1}
100
+ */
101
+ declare const stringifyArray: <T>(arr: T[], options: StringifyArrayOptions<T>) => {
102
+ result: string;
103
+ truncatedItems: number;
104
+ };
105
+ /**
106
+ * Display array as string with formatting and optional truncation message
107
+ * @param arr - Array to display
108
+ * @param options - Display options
109
+ * @returns Formatted string
110
+ */
111
+ declare const displayArray: <T>(arr: T[], options: StringifyArrayOptions<T> & {
112
+ emptyOutput: string;
113
+ }) => string;
114
+ /**
115
+ * Convert a word to plural form (simple English pluralization)
116
+ * @param input - Word to pluralize
117
+ * @param count - Count to determine if plural is needed
118
+ * @returns Pluralized word
119
+ * @example pluralize("cat", 2) // "cats", pluralize("cat", 1) // "cat"
120
+ */
121
+ declare const pluralize: (input: string, count: number) => string;
122
+ /**
123
+ * Convert string to snake_case
124
+ * @param input - String to convert
125
+ * @returns snake_case string
126
+ * @example snakeCase("helloWorld") // "hello_world"
127
+ */
128
+ declare const snakeCase: (input: string) => string;
129
+ /**
130
+ * Convert string to Title Case
131
+ * @param input - String to convert
132
+ * @returns Title Case string
133
+ * @example titleCase("hello world") // "Hello World"
134
+ */
135
+ declare const titleCase: (input: string) => string;
136
+ /**
137
+ * Convert string to kebab-case
138
+ * @param input - String to convert
139
+ * @returns kebab-case string
140
+ * @example kebabCase("helloWorld") // "hello-world"
141
+ */
142
+ declare const kebabCase: (input: string) => string;
143
+ /**
144
+ * Convert string to camelCase
145
+ * @param input - String to convert
146
+ * @returns camelCase string
147
+ * @example camelCase("hello world") // "helloWorld"
148
+ */
149
+ declare const camelCase: (input: string) => string;
150
+ /**
151
+ * Convert string to PascalCase
152
+ * @param input - String to convert
153
+ * @returns PascalCase string
154
+ * @example pascalCase("hello world") // "HelloWorld"
155
+ */
156
+ declare const pascalCase: (input: string) => string;
157
+ /**
158
+ * Split a string on uppercase letters
159
+ * @param input - String to split
160
+ * @param splitChar - Character to insert (default: " ")
161
+ * @returns Split string
162
+ * @example splitOnUppercase("helloWorld") // "hello World"
163
+ */
164
+ declare const splitOnUppercase: (input: string, splitChar?: string) => string;
165
+ /**
166
+ * Replace template tags in a string with custom delimiters
167
+ * @param input - String with template tags
168
+ * @param placeholders - Object with key-value pairs
169
+ * @param delimiters - Opening and closing delimiters (default: ["{", "}"])
170
+ * @returns String with replaced tags
171
+ * @example replaceTags("Hello {name}!", {name: "World"}) // "Hello World!"
172
+ * @example replaceTags("Hello {{name}}!", {name: "World"}, ["{{", "}}"])
173
+ * @example replaceTags("Hello [name]!", {name: "World"}, ["[", "]"])
174
+ */
175
+ declare const replaceTags: (input: string, placeholders: Record<string, string>, delimiters?: [string, string]) => string;
176
+ /**
177
+ * Check if a string is a valid URL
178
+ * @param input - String to check
179
+ * @returns True if valid URL
180
+ * @example isUrl("https://example.com") // true
181
+ */
182
+ declare const isUrl: (input: string) => boolean;
183
+
184
+ type strings_StringifyArrayOptions<T> = StringifyArrayOptions<T>;
185
+ declare const strings_camelCase: typeof camelCase;
186
+ declare const strings_capitalize: typeof capitalize;
187
+ declare const strings_capitalizeWords: typeof capitalizeWords;
188
+ declare const strings_countOccurrences: typeof countOccurrences;
189
+ declare const strings_displayArray: typeof displayArray;
190
+ declare const strings_escapeHtml: typeof escapeHtml;
191
+ declare const strings_isAlpha: typeof isAlpha;
192
+ declare const strings_isAlphanumeric: typeof isAlphanumeric;
193
+ declare const strings_isUrl: typeof isUrl;
194
+ declare const strings_kebabCase: typeof kebabCase;
195
+ declare const strings_pad: typeof pad;
196
+ declare const strings_pascalCase: typeof pascalCase;
197
+ declare const strings_pluralize: typeof pluralize;
198
+ declare const strings_replaceTags: typeof replaceTags;
199
+ declare const strings_reverse: typeof reverse;
200
+ declare const strings_slugify: typeof slugify;
201
+ declare const strings_snakeCase: typeof snakeCase;
202
+ declare const strings_splitOnUppercase: typeof splitOnUppercase;
203
+ declare const strings_stringifyArray: typeof stringifyArray;
204
+ declare const strings_titleCase: typeof titleCase;
205
+ declare const strings_truncate: typeof truncate;
206
+ declare const strings_unescapeHtml: typeof unescapeHtml;
207
+ declare namespace strings {
208
+ export { strings_camelCase as camelCase, strings_capitalize as capitalize, strings_capitalizeWords as capitalizeWords, strings_countOccurrences as countOccurrences, strings_displayArray as displayArray, strings_escapeHtml as escapeHtml, strings_isAlpha as isAlpha, strings_isAlphanumeric as isAlphanumeric, strings_isUrl as isUrl, strings_kebabCase as kebabCase, strings_pad as pad, strings_pascalCase as pascalCase, strings_pluralize as pluralize, strings_replaceTags as replaceTags, strings_reverse as reverse, strings_slugify as slugify, strings_snakeCase as snakeCase, strings_splitOnUppercase as splitOnUppercase, strings_stringifyArray as stringifyArray, strings_titleCase as titleCase, strings_truncate as truncate, strings_unescapeHtml as unescapeHtml };
209
+ export type { strings_StringifyArrayOptions as StringifyArrayOptions };
210
+ }
211
+
212
+ export { capitalizeWords as a, slugify as b, capitalize as c, countOccurrences as d, escapeHtml as e, isAlphanumeric as f, stringifyArray as g, displayArray as h, isAlpha as i, pluralize as j, snakeCase as k, titleCase as l, kebabCase as m, camelCase as n, pascalCase as o, pad as p, splitOnUppercase as q, reverse as r, strings as s, truncate as t, unescapeHtml as u, replaceTags as v, isUrl as w };
213
+ export type { StringifyArrayOptions as S };
@@ -0,0 +1,213 @@
1
+ type StringifyArrayOptions<T> = {
2
+ maxItems: number;
3
+ maxItemLength?: number;
4
+ maxTotalLength?: number;
5
+ stringify: (item: T) => string;
6
+ prefix?: string;
7
+ suffix?: string;
8
+ joinString?: string;
9
+ };
10
+ /**
11
+ * Truncate a string to a maximum length, adding a suffix if truncated
12
+ * @param input - String to truncate
13
+ * @param length - Maximum length
14
+ * @param suffix - Suffix to add (default: "...")
15
+ * @returns Truncated string
16
+ * @example truncate("Hello World", 8) // "Hello..."
17
+ */
18
+ declare const truncate: (input: string, length: number, suffix?: string) => string;
19
+ /**
20
+ * Capitalize the first letter of a string
21
+ * @param input - String to capitalize
22
+ * @returns Capitalized string
23
+ * @example capitalize("hello world") // "Hello world"
24
+ */
25
+ declare const capitalize: (input: string) => string;
26
+ /**
27
+ * Capitalize the first letter of each word
28
+ * @param input - String to capitalize
29
+ * @returns String with each word capitalized
30
+ * @example capitalizeWords("hello world") // "Hello World"
31
+ */
32
+ declare const capitalizeWords: (input: string) => string;
33
+ /**
34
+ * Create a URL-friendly slug from a string
35
+ * @param input - String to slugify
36
+ * @returns Slugified string
37
+ * @example slugify("Hello World!") // "hello-world"
38
+ */
39
+ declare const slugify: (input: string) => string;
40
+ /**
41
+ * Escape HTML special characters
42
+ * @param input - String to escape
43
+ * @returns Escaped string
44
+ * @example escapeHtml("<div>Hello</div>") // "&lt;div&gt;Hello&lt;/div&gt;"
45
+ */
46
+ declare const escapeHtml: (input: string) => string;
47
+ /**
48
+ * Unescape HTML entities
49
+ * @param input - String to unescape
50
+ * @returns Unescaped string
51
+ * @example unescapeHtml("&lt;div&gt;") // "<div>"
52
+ */
53
+ declare const unescapeHtml: (input: string) => string;
54
+ /**
55
+ * Reverse a string
56
+ * @param input - String to reverse
57
+ * @returns Reversed string
58
+ * @example reverse("hello") // "olleh"
59
+ */
60
+ declare const reverse: (input: string) => string;
61
+ /**
62
+ * Count occurrences of a substring
63
+ * @param input - String to search in
64
+ * @param search - Substring to count
65
+ * @param caseSensitive - Whether to be case sensitive (default: true)
66
+ * @returns Number of occurrences
67
+ * @example countOccurrences("hello hello world", "hello") // 2
68
+ */
69
+ declare const countOccurrences: (input: string, search: string, caseSensitive?: boolean) => number;
70
+ /**
71
+ * Check if a string contains only letters
72
+ * @param input - String to check
73
+ * @returns True if only letters
74
+ * @example isAlpha("hello") // true, isAlpha("hello123") // false
75
+ */
76
+ declare const isAlpha: (input: string) => boolean;
77
+ /**
78
+ * Check if a string contains only alphanumeric characters
79
+ * @param input - String to check
80
+ * @returns True if alphanumeric
81
+ * @example isAlphanumeric("hello123") // true, isAlphanumeric("hello-123") // false
82
+ */
83
+ declare const isAlphanumeric: (input: string) => boolean;
84
+ /**
85
+ * Pad a string to a certain length with a character
86
+ * @param input - String to pad
87
+ * @param length - Target length
88
+ * @param char - Character to pad with (default: " ")
89
+ * @param direction - Direction to pad ("left", "right", or "both")
90
+ * @returns Padded string
91
+ * @example pad("hello", 10, "*", "right") // "hello*****"
92
+ */
93
+ declare const pad: (input: string, length: number, char?: string, direction?: "left" | "right" | "both") => string;
94
+ /**
95
+ * Stringify an array with various formatting options
96
+ * @param arr - Array to stringify
97
+ * @param options - Formatting options (max items, max length, etc.)
98
+ * @returns Object with result string and truncation info
99
+ * @example stringifyArray([1, 2, 3], {maxItems: 2, stringify: String}) // {result: "1, 2", truncatedItems: 1}
100
+ */
101
+ declare const stringifyArray: <T>(arr: T[], options: StringifyArrayOptions<T>) => {
102
+ result: string;
103
+ truncatedItems: number;
104
+ };
105
+ /**
106
+ * Display array as string with formatting and optional truncation message
107
+ * @param arr - Array to display
108
+ * @param options - Display options
109
+ * @returns Formatted string
110
+ */
111
+ declare const displayArray: <T>(arr: T[], options: StringifyArrayOptions<T> & {
112
+ emptyOutput: string;
113
+ }) => string;
114
+ /**
115
+ * Convert a word to plural form (simple English pluralization)
116
+ * @param input - Word to pluralize
117
+ * @param count - Count to determine if plural is needed
118
+ * @returns Pluralized word
119
+ * @example pluralize("cat", 2) // "cats", pluralize("cat", 1) // "cat"
120
+ */
121
+ declare const pluralize: (input: string, count: number) => string;
122
+ /**
123
+ * Convert string to snake_case
124
+ * @param input - String to convert
125
+ * @returns snake_case string
126
+ * @example snakeCase("helloWorld") // "hello_world"
127
+ */
128
+ declare const snakeCase: (input: string) => string;
129
+ /**
130
+ * Convert string to Title Case
131
+ * @param input - String to convert
132
+ * @returns Title Case string
133
+ * @example titleCase("hello world") // "Hello World"
134
+ */
135
+ declare const titleCase: (input: string) => string;
136
+ /**
137
+ * Convert string to kebab-case
138
+ * @param input - String to convert
139
+ * @returns kebab-case string
140
+ * @example kebabCase("helloWorld") // "hello-world"
141
+ */
142
+ declare const kebabCase: (input: string) => string;
143
+ /**
144
+ * Convert string to camelCase
145
+ * @param input - String to convert
146
+ * @returns camelCase string
147
+ * @example camelCase("hello world") // "helloWorld"
148
+ */
149
+ declare const camelCase: (input: string) => string;
150
+ /**
151
+ * Convert string to PascalCase
152
+ * @param input - String to convert
153
+ * @returns PascalCase string
154
+ * @example pascalCase("hello world") // "HelloWorld"
155
+ */
156
+ declare const pascalCase: (input: string) => string;
157
+ /**
158
+ * Split a string on uppercase letters
159
+ * @param input - String to split
160
+ * @param splitChar - Character to insert (default: " ")
161
+ * @returns Split string
162
+ * @example splitOnUppercase("helloWorld") // "hello World"
163
+ */
164
+ declare const splitOnUppercase: (input: string, splitChar?: string) => string;
165
+ /**
166
+ * Replace template tags in a string with custom delimiters
167
+ * @param input - String with template tags
168
+ * @param placeholders - Object with key-value pairs
169
+ * @param delimiters - Opening and closing delimiters (default: ["{", "}"])
170
+ * @returns String with replaced tags
171
+ * @example replaceTags("Hello {name}!", {name: "World"}) // "Hello World!"
172
+ * @example replaceTags("Hello {{name}}!", {name: "World"}, ["{{", "}}"])
173
+ * @example replaceTags("Hello [name]!", {name: "World"}, ["[", "]"])
174
+ */
175
+ declare const replaceTags: (input: string, placeholders: Record<string, string>, delimiters?: [string, string]) => string;
176
+ /**
177
+ * Check if a string is a valid URL
178
+ * @param input - String to check
179
+ * @returns True if valid URL
180
+ * @example isUrl("https://example.com") // true
181
+ */
182
+ declare const isUrl: (input: string) => boolean;
183
+
184
+ type strings_StringifyArrayOptions<T> = StringifyArrayOptions<T>;
185
+ declare const strings_camelCase: typeof camelCase;
186
+ declare const strings_capitalize: typeof capitalize;
187
+ declare const strings_capitalizeWords: typeof capitalizeWords;
188
+ declare const strings_countOccurrences: typeof countOccurrences;
189
+ declare const strings_displayArray: typeof displayArray;
190
+ declare const strings_escapeHtml: typeof escapeHtml;
191
+ declare const strings_isAlpha: typeof isAlpha;
192
+ declare const strings_isAlphanumeric: typeof isAlphanumeric;
193
+ declare const strings_isUrl: typeof isUrl;
194
+ declare const strings_kebabCase: typeof kebabCase;
195
+ declare const strings_pad: typeof pad;
196
+ declare const strings_pascalCase: typeof pascalCase;
197
+ declare const strings_pluralize: typeof pluralize;
198
+ declare const strings_replaceTags: typeof replaceTags;
199
+ declare const strings_reverse: typeof reverse;
200
+ declare const strings_slugify: typeof slugify;
201
+ declare const strings_snakeCase: typeof snakeCase;
202
+ declare const strings_splitOnUppercase: typeof splitOnUppercase;
203
+ declare const strings_stringifyArray: typeof stringifyArray;
204
+ declare const strings_titleCase: typeof titleCase;
205
+ declare const strings_truncate: typeof truncate;
206
+ declare const strings_unescapeHtml: typeof unescapeHtml;
207
+ declare namespace strings {
208
+ export { strings_camelCase as camelCase, strings_capitalize as capitalize, strings_capitalizeWords as capitalizeWords, strings_countOccurrences as countOccurrences, strings_displayArray as displayArray, strings_escapeHtml as escapeHtml, strings_isAlpha as isAlpha, strings_isAlphanumeric as isAlphanumeric, strings_isUrl as isUrl, strings_kebabCase as kebabCase, strings_pad as pad, strings_pascalCase as pascalCase, strings_pluralize as pluralize, strings_replaceTags as replaceTags, strings_reverse as reverse, strings_slugify as slugify, strings_snakeCase as snakeCase, strings_splitOnUppercase as splitOnUppercase, strings_stringifyArray as stringifyArray, strings_titleCase as titleCase, strings_truncate as truncate, strings_unescapeHtml as unescapeHtml };
209
+ export type { strings_StringifyArrayOptions as StringifyArrayOptions };
210
+ }
211
+
212
+ export { capitalizeWords as a, slugify as b, capitalize as c, countOccurrences as d, escapeHtml as e, isAlphanumeric as f, stringifyArray as g, displayArray as h, isAlpha as i, pluralize as j, snakeCase as k, titleCase as l, kebabCase as m, camelCase as n, pascalCase as o, pad as p, splitOnUppercase as q, reverse as r, strings as s, truncate as t, unescapeHtml as u, replaceTags as v, isUrl as w };
213
+ export type { StringifyArrayOptions as S };
@@ -0,0 +1,68 @@
1
+ import { TimeMagic } from './constants/time.mjs';
2
+
3
+ /**
4
+ * Convert a timestamp in milliseconds to Unix timestamp (seconds)
5
+ * @param timestamp - Timestamp in milliseconds
6
+ * @returns Unix timestamp in seconds
7
+ * @example unix(1609459200000) // 1609459200
8
+ */
9
+ declare const unix: (timestamp: number) => number;
10
+ /**
11
+ * Get current Unix timestamp in seconds
12
+ * @returns Current Unix timestamp
13
+ * @example unixNow() // Current time in seconds
14
+ */
15
+ declare const unixNow: () => number;
16
+ /**
17
+ * Convert milliseconds to human readable format
18
+ * @param ms - Milliseconds to format
19
+ * @param maxParts - Maximum number of time parts to show (default: 2)
20
+ * @param msDisplay - What to display for very small values (default: "Just now")
21
+ * @returns Human readable string
22
+ * @example humanReadableMs(90000) // "1 minute and 30 seconds"
23
+ * @example humanReadableMs(3600000, 1) // "1 hour"
24
+ */
25
+ declare const humanReadableMs: (ms: number, maxParts?: number, msDisplay?: string | ((ms: number) => string)) => string;
26
+ /**
27
+ * Convert high-resolution time to milliseconds
28
+ * @param hrTime - High-resolution time tuple [seconds, nanoseconds]
29
+ * @returns Time in milliseconds
30
+ * @example hrTimeToMs([1, 500000000]) // 1500 (1.5 seconds)
31
+ */
32
+ declare const hrTimeToMs: (hrTime: [number, number]) => number;
33
+ /**
34
+ * Convert BigInt duration to human readable string
35
+ * @param start - Start time from process.hrtime.bigint()
36
+ * @returns Human readable duration string
37
+ * @example bigIntDurationToHumanReadable(startTime) // "123.456ms"
38
+ */
39
+ declare const bigIntDurationToHumanReadable: (start: bigint) => string;
40
+ /**
41
+ * Calculate average occurrences per interval from an array of dates
42
+ * @param dates - Array of dates
43
+ * @param interval - Interval in milliseconds
44
+ * @returns Average number of occurrences per interval
45
+ * @example occurrencesPerInterval([date1, date2, date3], 60000) // Avg per minute
46
+ */
47
+ declare const occurrencesPerInterval: (dates: Date[], interval: number) => number;
48
+
49
+ declare const time_TimeMagic: typeof TimeMagic;
50
+ declare const time_bigIntDurationToHumanReadable: typeof bigIntDurationToHumanReadable;
51
+ declare const time_hrTimeToMs: typeof hrTimeToMs;
52
+ declare const time_humanReadableMs: typeof humanReadableMs;
53
+ declare const time_occurrencesPerInterval: typeof occurrencesPerInterval;
54
+ declare const time_unix: typeof unix;
55
+ declare const time_unixNow: typeof unixNow;
56
+ declare namespace time {
57
+ export {
58
+ time_TimeMagic as TimeMagic,
59
+ time_bigIntDurationToHumanReadable as bigIntDurationToHumanReadable,
60
+ time_hrTimeToMs as hrTimeToMs,
61
+ time_humanReadableMs as humanReadableMs,
62
+ time_occurrencesPerInterval as occurrencesPerInterval,
63
+ time_unix as unix,
64
+ time_unixNow as unixNow,
65
+ };
66
+ }
67
+
68
+ export { unixNow as a, hrTimeToMs as b, bigIntDurationToHumanReadable as c, humanReadableMs as h, occurrencesPerInterval as o, time as t, unix as u };
@@ -1 +1 @@
1
- {"version":3,"file":"time-DmJNWZeL.mjs","sources":["../src/utils/time.ts"],"sourcesContent":["import { TimeMagic } from '../constants/time';\n\nconst unix = (timestamp: number): number =>\n\tMath.floor(timestamp / TimeMagic.MILLISECONDS_PER_SECOND);\n\nconst unixNow = (): number => unix(Date.now());\n\nconst humanReadableMs = (\n\tms: number,\n\tmaxParts = 2,\n\tmsDisplay: string | ((ms: number) => string) = 'Just now'\n): string => {\n\tconst days = (ms / TimeMagic.MILLISECONDS_PER_DAY) | 0;\n\tconst hours =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_DAY) / TimeMagic.MILLISECONDS_PER_HOUR) |\n\t\t0;\n\tconst minutes =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_HOUR) /\n\t\t\tTimeMagic.MILLISECONDS_PER_MINUTE) |\n\t\t0;\n\tconst seconds =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_MINUTE) /\n\t\t\tTimeMagic.MILLISECONDS_PER_SECOND) |\n\t\t0;\n\n\tconst parts = [];\n\tif (days > 0) parts.push(`${days} day${days === 1 ? '' : 's'}`);\n\tif (hours > 0) parts.push(`${hours} hour${hours === 1 ? '' : 's'}`);\n\tif (minutes > 0) parts.push(`${minutes} minute${minutes === 1 ? '' : 's'}`);\n\tif (seconds > 0) parts.push(`${seconds} second${seconds === 1 ? '' : 's'}`);\n\n\tconst formattedParts = parts.slice(0, maxParts);\n\tconst lastPart = formattedParts.pop();\n\n\tif (formattedParts.length > 0) {\n\t\treturn `${formattedParts.join(', ')}${formattedParts.length > 1 ? ',' : ''} and ${lastPart}`;\n\t} else\n\t\treturn (\n\t\t\tlastPart ?? (typeof msDisplay === 'function' ? msDisplay(ms) : msDisplay)\n\t\t);\n};\n\nconst hrTimeToMs = (hrTime: [number, number]): number =>\n\thrTime[0] * 1e3 + hrTime[1] / 1e6;\n\nconst bigIntDurationToHumanReadable = (start: bigint): string => {\n\tconst end = process.hrtime.bigint();\n\tconst ms = Number(end - start) / 1e6;\n\treturn `${ms.toFixed(3)}ms`;\n};\n\nconst occurrencesPerInterval = (dates: Date[], interval: number): number => {\n\tif (dates.length === 0) return 0;\n\n\tlet totalCount = 0;\n\tlet intervalCount = 0;\n\tconst map: Record<string, number> = {};\n\tconst baseTime = dates[0].getTime();\n\n\t// Iterate through the dates and count them in their respective intervals\n\tfor (const date of dates) {\n\t\tconst timeDiff = date.getTime() - baseTime;\n\t\tconst intervalIndex = Math.floor(timeDiff / interval);\n\n\t\tif (map[intervalIndex]) {\n\t\t\tmap[intervalIndex]++;\n\t\t} else {\n\t\t\tmap[intervalIndex] = 1;\n\t\t}\n\t}\n\n\t// Calculate the total count and number of intervals\n\tfor (const key in map) {\n\t\tconst val = map[key];\n\t\tif (!val) continue;\n\t\ttotalCount += val;\n\t\tintervalCount++;\n\t}\n\n\t// Calculate the average\n\treturn totalCount / intervalCount;\n};\n\nexport {\n\tunix,\n\tunixNow,\n\thumanReadableMs,\n\thrTimeToMs,\n\tbigIntDurationToHumanReadable,\n\toccurrencesPerInterval,\n\tTimeMagic,\n};\n"],"names":["unix","__name","timestamp","TimeMagic","unixNow","humanReadableMs","ms","maxParts","msDisplay","days","hours","minutes","seconds","parts","formattedParts","lastPart","hrTimeToMs","hrTime","bigIntDurationToHumanReadable","start","end","occurrencesPerInterval","dates","interval","totalCount","intervalCount","map","baseTime","date","timeDiff","intervalIndex","key","val"],"mappings":"gIAEA,MAAMA,EAAOC,EAACC,GACb,KAAK,MAAMA,EAAYC,EAAU,uBAAuB,EAD5C,QAGPC,EAAUH,EAAA,IAAcD,EAAK,KAAK,KAAK,EAA7B,WAEVK,EAAkBJ,EAAA,CACvBK,EACAC,EAAW,EACXC,EAA+C,aACnC,CACZ,MAAMC,EAAQH,EAAKH,EAAU,qBAAwB,EAC/CO,EACHJ,EAAKH,EAAU,qBAAwBA,EAAU,sBACnD,EACKQ,EACHL,EAAKH,EAAU,sBAChBA,EAAU,wBACX,EACKS,EACHN,EAAKH,EAAU,wBAChBA,EAAU,wBACX,EAEKU,EAAQ,CAAA,EACVJ,EAAO,GAAGI,EAAM,KAAK,GAAGJ,CAAI,OAAOA,IAAS,EAAI,GAAK,GAAG,EAAE,EAC1DC,EAAQ,GAAGG,EAAM,KAAK,GAAGH,CAAK,QAAQA,IAAU,EAAI,GAAK,GAAG,EAAE,EAC9DC,EAAU,GAAGE,EAAM,KAAK,GAAGF,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EACtEC,EAAU,GAAGC,EAAM,KAAK,GAAGD,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EAE1E,MAAME,EAAiBD,EAAM,MAAM,EAAGN,CAAQ,EACxCQ,EAAWD,EAAe,IAAA,EAEhC,OAAIA,EAAe,OAAS,EACpB,GAAGA,EAAe,KAAK,IAAI,CAAC,GAAGA,EAAe,OAAS,EAAI,IAAM,EAAE,QAAQC,CAAQ,GAGzFA,IAAa,OAAOP,GAAc,WAAaA,EAAUF,CAAE,EAAIE,EAElE,EAjCwB,mBAmClBQ,EAAaf,EAACgB,GACnBA,EAAO,CAAC,EAAI,IAAMA,EAAO,CAAC,EAAI,IADZ,cAGbC,EAAgCjB,EAACkB,GAA0B,CAChE,MAAMC,EAAM,QAAQ,OAAO,OAAA,EAE3B,MAAO,IADI,OAAOA,EAAMD,CAAK,EAAI,KACpB,QAAQ,CAAC,CAAC,IACxB,EAJsC,iCAMhCE,EAAyBpB,EAAA,CAACqB,EAAeC,IAA6B,CAC3E,GAAID,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAIE,EAAa,EACbC,EAAgB,EACpB,MAAMC,EAA8B,CAAA,EAC9BC,EAAWL,EAAM,CAAC,EAAE,QAAA,EAG1B,UAAWM,KAAQN,EAAO,CACzB,MAAMO,EAAWD,EAAK,QAAA,EAAYD,EAC5BG,EAAgB,KAAK,MAAMD,EAAWN,CAAQ,EAEhDG,EAAII,CAAa,EACpBJ,EAAII,CAAa,IAEjBJ,EAAII,CAAa,EAAI,CAEvB,CAGA,UAAWC,KAAOL,EAAK,CACtB,MAAMM,EAAMN,EAAIK,CAAG,EACdC,IACLR,GAAcQ,EACdP,IACD,CAGA,OAAOD,EAAaC,CACrB,EA9B+B"}
1
+ {"version":3,"file":"time-DmJNWZeL.mjs","sources":["../src/utils/time.ts"],"sourcesContent":["import { TimeMagic } from '../constants/time';\n\n/**\n * Convert a timestamp in milliseconds to Unix timestamp (seconds)\n * @param timestamp - Timestamp in milliseconds\n * @returns Unix timestamp in seconds\n * @example unix(1609459200000) // 1609459200\n */\nconst unix = (timestamp: number): number =>\n\tMath.floor(timestamp / TimeMagic.MILLISECONDS_PER_SECOND);\n\n/**\n * Get current Unix timestamp in seconds\n * @returns Current Unix timestamp\n * @example unixNow() // Current time in seconds\n */\nconst unixNow = (): number => unix(Date.now());\n\n/**\n * Convert milliseconds to human readable format\n * @param ms - Milliseconds to format\n * @param maxParts - Maximum number of time parts to show (default: 2)\n * @param msDisplay - What to display for very small values (default: \"Just now\")\n * @returns Human readable string\n * @example humanReadableMs(90000) // \"1 minute and 30 seconds\"\n * @example humanReadableMs(3600000, 1) // \"1 hour\"\n */\nconst humanReadableMs = (\n\tms: number,\n\tmaxParts = 2,\n\tmsDisplay: string | ((ms: number) => string) = 'Just now'\n): string => {\n\tconst days = (ms / TimeMagic.MILLISECONDS_PER_DAY) | 0;\n\tconst hours =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_DAY) / TimeMagic.MILLISECONDS_PER_HOUR) |\n\t\t0;\n\tconst minutes =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_HOUR) /\n\t\t\tTimeMagic.MILLISECONDS_PER_MINUTE) |\n\t\t0;\n\tconst seconds =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_MINUTE) /\n\t\t\tTimeMagic.MILLISECONDS_PER_SECOND) |\n\t\t0;\n\n\tconst parts = [];\n\tif (days > 0) parts.push(`${days} day${days === 1 ? '' : 's'}`);\n\tif (hours > 0) parts.push(`${hours} hour${hours === 1 ? '' : 's'}`);\n\tif (minutes > 0) parts.push(`${minutes} minute${minutes === 1 ? '' : 's'}`);\n\tif (seconds > 0) parts.push(`${seconds} second${seconds === 1 ? '' : 's'}`);\n\n\tconst formattedParts = parts.slice(0, maxParts);\n\tconst lastPart = formattedParts.pop();\n\n\tif (formattedParts.length > 0) {\n\t\treturn `${formattedParts.join(', ')}${formattedParts.length > 1 ? ',' : ''} and ${lastPart}`;\n\t} else\n\t\treturn (\n\t\t\tlastPart ?? (typeof msDisplay === 'function' ? msDisplay(ms) : msDisplay)\n\t\t);\n};\n\n/**\n * Convert high-resolution time to milliseconds\n * @param hrTime - High-resolution time tuple [seconds, nanoseconds]\n * @returns Time in milliseconds\n * @example hrTimeToMs([1, 500000000]) // 1500 (1.5 seconds)\n */\nconst hrTimeToMs = (hrTime: [number, number]): number =>\n\thrTime[0] * 1e3 + hrTime[1] / 1e6;\n\n/**\n * Convert BigInt duration to human readable string\n * @param start - Start time from process.hrtime.bigint()\n * @returns Human readable duration string\n * @example bigIntDurationToHumanReadable(startTime) // \"123.456ms\"\n */\nconst bigIntDurationToHumanReadable = (start: bigint): string => {\n\tconst end = process.hrtime.bigint();\n\tconst ms = Number(end - start) / 1e6;\n\treturn `${ms.toFixed(3)}ms`;\n};\n\n/**\n * Calculate average occurrences per interval from an array of dates\n * @param dates - Array of dates\n * @param interval - Interval in milliseconds\n * @returns Average number of occurrences per interval\n * @example occurrencesPerInterval([date1, date2, date3], 60000) // Avg per minute\n */\nconst occurrencesPerInterval = (dates: Date[], interval: number): number => {\n\tif (dates.length === 0) return 0;\n\n\tlet totalCount = 0;\n\tlet intervalCount = 0;\n\tconst map: Record<string, number> = {};\n\tconst baseTime = dates[0].getTime();\n\n\t// Iterate through the dates and count them in their respective intervals\n\tfor (const date of dates) {\n\t\tconst timeDiff = date.getTime() - baseTime;\n\t\tconst intervalIndex = Math.floor(timeDiff / interval);\n\n\t\tif (map[intervalIndex]) {\n\t\t\tmap[intervalIndex]++;\n\t\t} else {\n\t\t\tmap[intervalIndex] = 1;\n\t\t}\n\t}\n\n\t// Calculate the total count and number of intervals\n\tfor (const key in map) {\n\t\tconst val = map[key];\n\t\tif (!val) continue;\n\t\ttotalCount += val;\n\t\tintervalCount++;\n\t}\n\n\t// Calculate the average\n\treturn totalCount / intervalCount;\n};\n\nexport {\n\tunix,\n\tunixNow,\n\thumanReadableMs,\n\thrTimeToMs,\n\tbigIntDurationToHumanReadable,\n\toccurrencesPerInterval,\n\tTimeMagic,\n};\n"],"names":["unix","__name","timestamp","TimeMagic","unixNow","humanReadableMs","ms","maxParts","msDisplay","days","hours","minutes","seconds","parts","formattedParts","lastPart","hrTimeToMs","hrTime","bigIntDurationToHumanReadable","start","end","occurrencesPerInterval","dates","interval","totalCount","intervalCount","map","baseTime","date","timeDiff","intervalIndex","key","val"],"mappings":"gIAQA,MAAMA,EAAOC,EAACC,GACb,KAAK,MAAMA,EAAYC,EAAU,uBAAuB,EAD5C,QAQPC,EAAUH,EAAA,IAAcD,EAAK,KAAK,KAAK,EAA7B,WAWVK,EAAkBJ,EAAA,CACvBK,EACAC,EAAW,EACXC,EAA+C,aACnC,CACZ,MAAMC,EAAQH,EAAKH,EAAU,qBAAwB,EAC/CO,EACHJ,EAAKH,EAAU,qBAAwBA,EAAU,sBACnD,EACKQ,EACHL,EAAKH,EAAU,sBAChBA,EAAU,wBACX,EACKS,EACHN,EAAKH,EAAU,wBAChBA,EAAU,wBACX,EAEKU,EAAQ,CAAA,EACVJ,EAAO,GAAGI,EAAM,KAAK,GAAGJ,CAAI,OAAOA,IAAS,EAAI,GAAK,GAAG,EAAE,EAC1DC,EAAQ,GAAGG,EAAM,KAAK,GAAGH,CAAK,QAAQA,IAAU,EAAI,GAAK,GAAG,EAAE,EAC9DC,EAAU,GAAGE,EAAM,KAAK,GAAGF,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EACtEC,EAAU,GAAGC,EAAM,KAAK,GAAGD,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EAE1E,MAAME,EAAiBD,EAAM,MAAM,EAAGN,CAAQ,EACxCQ,EAAWD,EAAe,IAAA,EAEhC,OAAIA,EAAe,OAAS,EACpB,GAAGA,EAAe,KAAK,IAAI,CAAC,GAAGA,EAAe,OAAS,EAAI,IAAM,EAAE,QAAQC,CAAQ,GAGzFA,IAAa,OAAOP,GAAc,WAAaA,EAAUF,CAAE,EAAIE,EAElE,EAjCwB,mBAyClBQ,EAAaf,EAACgB,GACnBA,EAAO,CAAC,EAAI,IAAMA,EAAO,CAAC,EAAI,IADZ,cASbC,EAAgCjB,EAACkB,GAA0B,CAChE,MAAMC,EAAM,QAAQ,OAAO,OAAA,EAE3B,MAAO,IADI,OAAOA,EAAMD,CAAK,EAAI,KACpB,QAAQ,CAAC,CAAC,IACxB,EAJsC,iCAahCE,EAAyBpB,EAAA,CAACqB,EAAeC,IAA6B,CAC3E,GAAID,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAIE,EAAa,EACbC,EAAgB,EACpB,MAAMC,EAA8B,CAAA,EAC9BC,EAAWL,EAAM,CAAC,EAAE,QAAA,EAG1B,UAAWM,KAAQN,EAAO,CACzB,MAAMO,EAAWD,EAAK,QAAA,EAAYD,EAC5BG,EAAgB,KAAK,MAAMD,EAAWN,CAAQ,EAEhDG,EAAII,CAAa,EACpBJ,EAAII,CAAa,IAEjBJ,EAAII,CAAa,EAAI,CAEvB,CAGA,UAAWC,KAAOL,EAAK,CACtB,MAAMM,EAAMN,EAAIK,CAAG,EACdC,IACLR,GAAcQ,EACdP,IACD,CAGA,OAAOD,EAAaC,CACrB,EA9B+B"}
@@ -0,0 +1,68 @@
1
+ import { TimeMagic } from './constants/time.cjs';
2
+
3
+ /**
4
+ * Convert a timestamp in milliseconds to Unix timestamp (seconds)
5
+ * @param timestamp - Timestamp in milliseconds
6
+ * @returns Unix timestamp in seconds
7
+ * @example unix(1609459200000) // 1609459200
8
+ */
9
+ declare const unix: (timestamp: number) => number;
10
+ /**
11
+ * Get current Unix timestamp in seconds
12
+ * @returns Current Unix timestamp
13
+ * @example unixNow() // Current time in seconds
14
+ */
15
+ declare const unixNow: () => number;
16
+ /**
17
+ * Convert milliseconds to human readable format
18
+ * @param ms - Milliseconds to format
19
+ * @param maxParts - Maximum number of time parts to show (default: 2)
20
+ * @param msDisplay - What to display for very small values (default: "Just now")
21
+ * @returns Human readable string
22
+ * @example humanReadableMs(90000) // "1 minute and 30 seconds"
23
+ * @example humanReadableMs(3600000, 1) // "1 hour"
24
+ */
25
+ declare const humanReadableMs: (ms: number, maxParts?: number, msDisplay?: string | ((ms: number) => string)) => string;
26
+ /**
27
+ * Convert high-resolution time to milliseconds
28
+ * @param hrTime - High-resolution time tuple [seconds, nanoseconds]
29
+ * @returns Time in milliseconds
30
+ * @example hrTimeToMs([1, 500000000]) // 1500 (1.5 seconds)
31
+ */
32
+ declare const hrTimeToMs: (hrTime: [number, number]) => number;
33
+ /**
34
+ * Convert BigInt duration to human readable string
35
+ * @param start - Start time from process.hrtime.bigint()
36
+ * @returns Human readable duration string
37
+ * @example bigIntDurationToHumanReadable(startTime) // "123.456ms"
38
+ */
39
+ declare const bigIntDurationToHumanReadable: (start: bigint) => string;
40
+ /**
41
+ * Calculate average occurrences per interval from an array of dates
42
+ * @param dates - Array of dates
43
+ * @param interval - Interval in milliseconds
44
+ * @returns Average number of occurrences per interval
45
+ * @example occurrencesPerInterval([date1, date2, date3], 60000) // Avg per minute
46
+ */
47
+ declare const occurrencesPerInterval: (dates: Date[], interval: number) => number;
48
+
49
+ declare const time_TimeMagic: typeof TimeMagic;
50
+ declare const time_bigIntDurationToHumanReadable: typeof bigIntDurationToHumanReadable;
51
+ declare const time_hrTimeToMs: typeof hrTimeToMs;
52
+ declare const time_humanReadableMs: typeof humanReadableMs;
53
+ declare const time_occurrencesPerInterval: typeof occurrencesPerInterval;
54
+ declare const time_unix: typeof unix;
55
+ declare const time_unixNow: typeof unixNow;
56
+ declare namespace time {
57
+ export {
58
+ time_TimeMagic as TimeMagic,
59
+ time_bigIntDurationToHumanReadable as bigIntDurationToHumanReadable,
60
+ time_hrTimeToMs as hrTimeToMs,
61
+ time_humanReadableMs as humanReadableMs,
62
+ time_occurrencesPerInterval as occurrencesPerInterval,
63
+ time_unix as unix,
64
+ time_unixNow as unixNow,
65
+ };
66
+ }
67
+
68
+ export { unixNow as a, hrTimeToMs as b, bigIntDurationToHumanReadable as c, humanReadableMs as h, occurrencesPerInterval as o, time as t, unix as u };
@@ -1 +1 @@
1
- {"version":3,"file":"time-yNkQSJnQ.cjs","sources":["../src/utils/time.ts"],"sourcesContent":["import { TimeMagic } from '../constants/time';\n\nconst unix = (timestamp: number): number =>\n\tMath.floor(timestamp / TimeMagic.MILLISECONDS_PER_SECOND);\n\nconst unixNow = (): number => unix(Date.now());\n\nconst humanReadableMs = (\n\tms: number,\n\tmaxParts = 2,\n\tmsDisplay: string | ((ms: number) => string) = 'Just now'\n): string => {\n\tconst days = (ms / TimeMagic.MILLISECONDS_PER_DAY) | 0;\n\tconst hours =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_DAY) / TimeMagic.MILLISECONDS_PER_HOUR) |\n\t\t0;\n\tconst minutes =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_HOUR) /\n\t\t\tTimeMagic.MILLISECONDS_PER_MINUTE) |\n\t\t0;\n\tconst seconds =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_MINUTE) /\n\t\t\tTimeMagic.MILLISECONDS_PER_SECOND) |\n\t\t0;\n\n\tconst parts = [];\n\tif (days > 0) parts.push(`${days} day${days === 1 ? '' : 's'}`);\n\tif (hours > 0) parts.push(`${hours} hour${hours === 1 ? '' : 's'}`);\n\tif (minutes > 0) parts.push(`${minutes} minute${minutes === 1 ? '' : 's'}`);\n\tif (seconds > 0) parts.push(`${seconds} second${seconds === 1 ? '' : 's'}`);\n\n\tconst formattedParts = parts.slice(0, maxParts);\n\tconst lastPart = formattedParts.pop();\n\n\tif (formattedParts.length > 0) {\n\t\treturn `${formattedParts.join(', ')}${formattedParts.length > 1 ? ',' : ''} and ${lastPart}`;\n\t} else\n\t\treturn (\n\t\t\tlastPart ?? (typeof msDisplay === 'function' ? msDisplay(ms) : msDisplay)\n\t\t);\n};\n\nconst hrTimeToMs = (hrTime: [number, number]): number =>\n\thrTime[0] * 1e3 + hrTime[1] / 1e6;\n\nconst bigIntDurationToHumanReadable = (start: bigint): string => {\n\tconst end = process.hrtime.bigint();\n\tconst ms = Number(end - start) / 1e6;\n\treturn `${ms.toFixed(3)}ms`;\n};\n\nconst occurrencesPerInterval = (dates: Date[], interval: number): number => {\n\tif (dates.length === 0) return 0;\n\n\tlet totalCount = 0;\n\tlet intervalCount = 0;\n\tconst map: Record<string, number> = {};\n\tconst baseTime = dates[0].getTime();\n\n\t// Iterate through the dates and count them in their respective intervals\n\tfor (const date of dates) {\n\t\tconst timeDiff = date.getTime() - baseTime;\n\t\tconst intervalIndex = Math.floor(timeDiff / interval);\n\n\t\tif (map[intervalIndex]) {\n\t\t\tmap[intervalIndex]++;\n\t\t} else {\n\t\t\tmap[intervalIndex] = 1;\n\t\t}\n\t}\n\n\t// Calculate the total count and number of intervals\n\tfor (const key in map) {\n\t\tconst val = map[key];\n\t\tif (!val) continue;\n\t\ttotalCount += val;\n\t\tintervalCount++;\n\t}\n\n\t// Calculate the average\n\treturn totalCount / intervalCount;\n};\n\nexport {\n\tunix,\n\tunixNow,\n\thumanReadableMs,\n\thrTimeToMs,\n\tbigIntDurationToHumanReadable,\n\toccurrencesPerInterval,\n\tTimeMagic,\n};\n"],"names":["unix","__name","timestamp","TimeMagic","unixNow","humanReadableMs","ms","maxParts","msDisplay","days","hours","minutes","seconds","parts","formattedParts","lastPart","hrTimeToMs","hrTime","bigIntDurationToHumanReadable","start","end","occurrencesPerInterval","dates","interval","totalCount","intervalCount","map","baseTime","date","timeDiff","intervalIndex","key","val"],"mappings":"kIAEA,MAAMA,EAAOC,EAACC,GACb,KAAK,MAAMA,EAAYC,EAAAA,UAAU,uBAAuB,EAD5C,QAGPC,EAAUH,EAAA,IAAcD,EAAK,KAAK,KAAK,EAA7B,WAEVK,EAAkBJ,EAAA,CACvBK,EACAC,EAAW,EACXC,EAA+C,aACnC,CACZ,MAAMC,EAAQH,EAAKH,EAAAA,UAAU,qBAAwB,EAC/CO,EACHJ,EAAKH,EAAAA,UAAU,qBAAwBA,EAAAA,UAAU,sBACnD,EACKQ,EACHL,EAAKH,EAAAA,UAAU,sBAChBA,EAAAA,UAAU,wBACX,EACKS,EACHN,EAAKH,EAAAA,UAAU,wBAChBA,EAAAA,UAAU,wBACX,EAEKU,EAAQ,CAAA,EACVJ,EAAO,GAAGI,EAAM,KAAK,GAAGJ,CAAI,OAAOA,IAAS,EAAI,GAAK,GAAG,EAAE,EAC1DC,EAAQ,GAAGG,EAAM,KAAK,GAAGH,CAAK,QAAQA,IAAU,EAAI,GAAK,GAAG,EAAE,EAC9DC,EAAU,GAAGE,EAAM,KAAK,GAAGF,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EACtEC,EAAU,GAAGC,EAAM,KAAK,GAAGD,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EAE1E,MAAME,EAAiBD,EAAM,MAAM,EAAGN,CAAQ,EACxCQ,EAAWD,EAAe,IAAA,EAEhC,OAAIA,EAAe,OAAS,EACpB,GAAGA,EAAe,KAAK,IAAI,CAAC,GAAGA,EAAe,OAAS,EAAI,IAAM,EAAE,QAAQC,CAAQ,GAGzFA,IAAa,OAAOP,GAAc,WAAaA,EAAUF,CAAE,EAAIE,EAElE,EAjCwB,mBAmClBQ,EAAaf,EAACgB,GACnBA,EAAO,CAAC,EAAI,IAAMA,EAAO,CAAC,EAAI,IADZ,cAGbC,EAAgCjB,EAACkB,GAA0B,CAChE,MAAMC,EAAM,QAAQ,OAAO,OAAA,EAE3B,MAAO,IADI,OAAOA,EAAMD,CAAK,EAAI,KACpB,QAAQ,CAAC,CAAC,IACxB,EAJsC,iCAMhCE,EAAyBpB,EAAA,CAACqB,EAAeC,IAA6B,CAC3E,GAAID,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAIE,EAAa,EACbC,EAAgB,EACpB,MAAMC,EAA8B,CAAA,EAC9BC,EAAWL,EAAM,CAAC,EAAE,QAAA,EAG1B,UAAWM,KAAQN,EAAO,CACzB,MAAMO,EAAWD,EAAK,QAAA,EAAYD,EAC5BG,EAAgB,KAAK,MAAMD,EAAWN,CAAQ,EAEhDG,EAAII,CAAa,EACpBJ,EAAII,CAAa,IAEjBJ,EAAII,CAAa,EAAI,CAEvB,CAGA,UAAWC,KAAOL,EAAK,CACtB,MAAMM,EAAMN,EAAIK,CAAG,EACdC,IACLR,GAAcQ,EACdP,IACD,CAGA,OAAOD,EAAaC,CACrB,EA9B+B"}
1
+ {"version":3,"file":"time-yNkQSJnQ.cjs","sources":["../src/utils/time.ts"],"sourcesContent":["import { TimeMagic } from '../constants/time';\n\n/**\n * Convert a timestamp in milliseconds to Unix timestamp (seconds)\n * @param timestamp - Timestamp in milliseconds\n * @returns Unix timestamp in seconds\n * @example unix(1609459200000) // 1609459200\n */\nconst unix = (timestamp: number): number =>\n\tMath.floor(timestamp / TimeMagic.MILLISECONDS_PER_SECOND);\n\n/**\n * Get current Unix timestamp in seconds\n * @returns Current Unix timestamp\n * @example unixNow() // Current time in seconds\n */\nconst unixNow = (): number => unix(Date.now());\n\n/**\n * Convert milliseconds to human readable format\n * @param ms - Milliseconds to format\n * @param maxParts - Maximum number of time parts to show (default: 2)\n * @param msDisplay - What to display for very small values (default: \"Just now\")\n * @returns Human readable string\n * @example humanReadableMs(90000) // \"1 minute and 30 seconds\"\n * @example humanReadableMs(3600000, 1) // \"1 hour\"\n */\nconst humanReadableMs = (\n\tms: number,\n\tmaxParts = 2,\n\tmsDisplay: string | ((ms: number) => string) = 'Just now'\n): string => {\n\tconst days = (ms / TimeMagic.MILLISECONDS_PER_DAY) | 0;\n\tconst hours =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_DAY) / TimeMagic.MILLISECONDS_PER_HOUR) |\n\t\t0;\n\tconst minutes =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_HOUR) /\n\t\t\tTimeMagic.MILLISECONDS_PER_MINUTE) |\n\t\t0;\n\tconst seconds =\n\t\t((ms % TimeMagic.MILLISECONDS_PER_MINUTE) /\n\t\t\tTimeMagic.MILLISECONDS_PER_SECOND) |\n\t\t0;\n\n\tconst parts = [];\n\tif (days > 0) parts.push(`${days} day${days === 1 ? '' : 's'}`);\n\tif (hours > 0) parts.push(`${hours} hour${hours === 1 ? '' : 's'}`);\n\tif (minutes > 0) parts.push(`${minutes} minute${minutes === 1 ? '' : 's'}`);\n\tif (seconds > 0) parts.push(`${seconds} second${seconds === 1 ? '' : 's'}`);\n\n\tconst formattedParts = parts.slice(0, maxParts);\n\tconst lastPart = formattedParts.pop();\n\n\tif (formattedParts.length > 0) {\n\t\treturn `${formattedParts.join(', ')}${formattedParts.length > 1 ? ',' : ''} and ${lastPart}`;\n\t} else\n\t\treturn (\n\t\t\tlastPart ?? (typeof msDisplay === 'function' ? msDisplay(ms) : msDisplay)\n\t\t);\n};\n\n/**\n * Convert high-resolution time to milliseconds\n * @param hrTime - High-resolution time tuple [seconds, nanoseconds]\n * @returns Time in milliseconds\n * @example hrTimeToMs([1, 500000000]) // 1500 (1.5 seconds)\n */\nconst hrTimeToMs = (hrTime: [number, number]): number =>\n\thrTime[0] * 1e3 + hrTime[1] / 1e6;\n\n/**\n * Convert BigInt duration to human readable string\n * @param start - Start time from process.hrtime.bigint()\n * @returns Human readable duration string\n * @example bigIntDurationToHumanReadable(startTime) // \"123.456ms\"\n */\nconst bigIntDurationToHumanReadable = (start: bigint): string => {\n\tconst end = process.hrtime.bigint();\n\tconst ms = Number(end - start) / 1e6;\n\treturn `${ms.toFixed(3)}ms`;\n};\n\n/**\n * Calculate average occurrences per interval from an array of dates\n * @param dates - Array of dates\n * @param interval - Interval in milliseconds\n * @returns Average number of occurrences per interval\n * @example occurrencesPerInterval([date1, date2, date3], 60000) // Avg per minute\n */\nconst occurrencesPerInterval = (dates: Date[], interval: number): number => {\n\tif (dates.length === 0) return 0;\n\n\tlet totalCount = 0;\n\tlet intervalCount = 0;\n\tconst map: Record<string, number> = {};\n\tconst baseTime = dates[0].getTime();\n\n\t// Iterate through the dates and count them in their respective intervals\n\tfor (const date of dates) {\n\t\tconst timeDiff = date.getTime() - baseTime;\n\t\tconst intervalIndex = Math.floor(timeDiff / interval);\n\n\t\tif (map[intervalIndex]) {\n\t\t\tmap[intervalIndex]++;\n\t\t} else {\n\t\t\tmap[intervalIndex] = 1;\n\t\t}\n\t}\n\n\t// Calculate the total count and number of intervals\n\tfor (const key in map) {\n\t\tconst val = map[key];\n\t\tif (!val) continue;\n\t\ttotalCount += val;\n\t\tintervalCount++;\n\t}\n\n\t// Calculate the average\n\treturn totalCount / intervalCount;\n};\n\nexport {\n\tunix,\n\tunixNow,\n\thumanReadableMs,\n\thrTimeToMs,\n\tbigIntDurationToHumanReadable,\n\toccurrencesPerInterval,\n\tTimeMagic,\n};\n"],"names":["unix","__name","timestamp","TimeMagic","unixNow","humanReadableMs","ms","maxParts","msDisplay","days","hours","minutes","seconds","parts","formattedParts","lastPart","hrTimeToMs","hrTime","bigIntDurationToHumanReadable","start","end","occurrencesPerInterval","dates","interval","totalCount","intervalCount","map","baseTime","date","timeDiff","intervalIndex","key","val"],"mappings":"kIAQA,MAAMA,EAAOC,EAACC,GACb,KAAK,MAAMA,EAAYC,EAAAA,UAAU,uBAAuB,EAD5C,QAQPC,EAAUH,EAAA,IAAcD,EAAK,KAAK,KAAK,EAA7B,WAWVK,EAAkBJ,EAAA,CACvBK,EACAC,EAAW,EACXC,EAA+C,aACnC,CACZ,MAAMC,EAAQH,EAAKH,EAAAA,UAAU,qBAAwB,EAC/CO,EACHJ,EAAKH,EAAAA,UAAU,qBAAwBA,EAAAA,UAAU,sBACnD,EACKQ,EACHL,EAAKH,EAAAA,UAAU,sBAChBA,EAAAA,UAAU,wBACX,EACKS,EACHN,EAAKH,EAAAA,UAAU,wBAChBA,EAAAA,UAAU,wBACX,EAEKU,EAAQ,CAAA,EACVJ,EAAO,GAAGI,EAAM,KAAK,GAAGJ,CAAI,OAAOA,IAAS,EAAI,GAAK,GAAG,EAAE,EAC1DC,EAAQ,GAAGG,EAAM,KAAK,GAAGH,CAAK,QAAQA,IAAU,EAAI,GAAK,GAAG,EAAE,EAC9DC,EAAU,GAAGE,EAAM,KAAK,GAAGF,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EACtEC,EAAU,GAAGC,EAAM,KAAK,GAAGD,CAAO,UAAUA,IAAY,EAAI,GAAK,GAAG,EAAE,EAE1E,MAAME,EAAiBD,EAAM,MAAM,EAAGN,CAAQ,EACxCQ,EAAWD,EAAe,IAAA,EAEhC,OAAIA,EAAe,OAAS,EACpB,GAAGA,EAAe,KAAK,IAAI,CAAC,GAAGA,EAAe,OAAS,EAAI,IAAM,EAAE,QAAQC,CAAQ,GAGzFA,IAAa,OAAOP,GAAc,WAAaA,EAAUF,CAAE,EAAIE,EAElE,EAjCwB,mBAyClBQ,EAAaf,EAACgB,GACnBA,EAAO,CAAC,EAAI,IAAMA,EAAO,CAAC,EAAI,IADZ,cASbC,EAAgCjB,EAACkB,GAA0B,CAChE,MAAMC,EAAM,QAAQ,OAAO,OAAA,EAE3B,MAAO,IADI,OAAOA,EAAMD,CAAK,EAAI,KACpB,QAAQ,CAAC,CAAC,IACxB,EAJsC,iCAahCE,EAAyBpB,EAAA,CAACqB,EAAeC,IAA6B,CAC3E,GAAID,EAAM,SAAW,EAAG,MAAO,GAE/B,IAAIE,EAAa,EACbC,EAAgB,EACpB,MAAMC,EAA8B,CAAA,EAC9BC,EAAWL,EAAM,CAAC,EAAE,QAAA,EAG1B,UAAWM,KAAQN,EAAO,CACzB,MAAMO,EAAWD,EAAK,QAAA,EAAYD,EAC5BG,EAAgB,KAAK,MAAMD,EAAWN,CAAQ,EAEhDG,EAAII,CAAa,EACpBJ,EAAII,CAAa,IAEjBJ,EAAII,CAAa,EAAI,CAEvB,CAGA,UAAWC,KAAOL,EAAK,CACtB,MAAMM,EAAMN,EAAIK,CAAG,EACdC,IACLR,GAAcQ,EACdP,IACD,CAGA,OAAOD,EAAaC,CACrB,EA9B+B"}
@@ -1,2 +1,2 @@
1
- "use strict";require("../strings-DV446vv-.cjs");var r=require("../arrays-DaB1Xn47.cjs");exports.chunk=r.chunk,exports.isBooleanArray=r.isBooleanArray,exports.isNumberArray=r.isNumberArray,exports.isObjectArray=r.isObjectArray,exports.isStringArray=r.isStringArray,exports.join=r.join;
1
+ "use strict";require("../strings-_1vAPvzS.cjs");var r=require("../arrays-bgbansWs.cjs");exports.chunk=r.chunk,exports.difference=r.difference,exports.flatten=r.flatten,exports.flattenDeep=r.flattenDeep,exports.groupBy=r.groupBy,exports.intersection=r.intersection,exports.isBooleanArray=r.isBooleanArray,exports.isNumberArray=r.isNumberArray,exports.isObjectArray=r.isObjectArray,exports.isStringArray=r.isStringArray,exports.join=r.join,exports.partition=r.partition,exports.shuffle=r.shuffle,exports.union=r.union,exports.unique=r.unique,exports.uniqueBy=r.uniqueBy;
2
2
  //# sourceMappingURL=arrays.cjs.map
@@ -1 +1 @@
1
- export { J as JoinOptions, c as chunk, d as isBooleanArray, b as isNumberArray, e as isObjectArray, i as isStringArray, j as join } from '../arrays-CElcW69H.cjs';
1
+ export { J as JoinOptions, c as chunk, e as difference, f as flatten, d as flattenDeep, h as groupBy, i as intersection, m as isBooleanArray, l as isNumberArray, n as isObjectArray, k as isStringArray, j as join, p as partition, s as shuffle, g as union, u as unique, b as uniqueBy } from '../arrays-DvPJ1GeR.cjs';
@@ -1 +1 @@
1
- export { J as JoinOptions, c as chunk, d as isBooleanArray, b as isNumberArray, e as isObjectArray, i as isStringArray, j as join } from '../arrays-CElcW69H.mjs';
1
+ export { J as JoinOptions, c as chunk, e as difference, f as flatten, d as flattenDeep, h as groupBy, i as intersection, m as isBooleanArray, l as isNumberArray, n as isObjectArray, k as isStringArray, j as join, p as partition, s as shuffle, g as union, u as unique, b as uniqueBy } from '../arrays-DvPJ1GeR.mjs';
@@ -1,2 +1,2 @@
1
- import"../strings-B0BRwNX9.mjs";import{c as i,d as o,b as e,e as n,i as t,j as y}from"../arrays-BkHBzTDO.mjs";export{i as chunk,o as isBooleanArray,e as isNumberArray,n as isObjectArray,t as isStringArray,y as join};
1
+ import"../strings-CrzGdnZH.mjs";import{c as r,e as i,f as n,d as t,h as o,i as u,m as f,l as p,n as y,k as c,j as l,p as m,s as A,g as b,u as g,b as h}from"../arrays-6DA6GfsQ.mjs";export{r as chunk,i as difference,n as flatten,t as flattenDeep,o as groupBy,u as intersection,f as isBooleanArray,p as isNumberArray,y as isObjectArray,c as isStringArray,l as join,m as partition,A as shuffle,b as union,g as unique,h as uniqueBy};
2
2
  //# sourceMappingURL=arrays.mjs.map
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("../arrays-DaB1Xn47.cjs"),i=require("../mime-types-BmvBrrZ7.cjs"),e=require("../numbers-Du__2-8Y.cjs"),s=require("../objects-CnGoVkh6.cjs"),t=require("../random-D1e1NTOt.cjs"),u=require("../runtime-peVFcWot.cjs"),m=require("../strings-DV446vv-.cjs"),a=require("../time-yNkQSJnQ.cjs");require("../constants/time.cjs"),exports.ArrayUtils=r.arrays,exports.MimeTypeUtils=i.mimeTypes,exports.NumberUtils=e.numbers,exports.ObjectUtils=s.objects,exports.RandomUtils=t.random,exports.RuntimeUtils=u.runtime,exports.StringUtils=m.strings,exports.TimeUtils=a.time;
1
+ "use strict";var r=require("../arrays-bgbansWs.cjs"),e=require("../files-m1nnj5gT.cjs"),i=require("../mime-types-BmvBrrZ7.cjs"),s=require("../numbers-B_mptknO.cjs"),t=require("../objects-wcO6hNA8.cjs"),u=require("../random-668tofPV.cjs"),l=require("../runtime-Bfs-yn_-.cjs"),a=require("../strings-_1vAPvzS.cjs"),m=require("../time-yNkQSJnQ.cjs");require("node:fs"),require("node:path"),require("../constants/bytes.cjs"),require("../constants/time.cjs"),exports.ArrayUtils=r.arrays,exports.FileUtils=e.files,exports.MimeTypeUtils=i.mimeTypes,exports.NumberUtils=s.numbers,exports.ObjectUtils=t.objects,exports.RandomUtils=u.random,exports.RuntimeUtils=l.runtime,exports.StringUtils=a.strings,exports.TimeUtils=m.time;
2
2
  //# sourceMappingURL=index.cjs.map