@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.
- package/dist/arrays-6DA6GfsQ.mjs +2 -0
- package/dist/arrays-6DA6GfsQ.mjs.map +1 -0
- package/dist/arrays-DvPJ1GeR.d.cts +163 -0
- package/dist/arrays-DvPJ1GeR.d.mts +163 -0
- package/dist/arrays-bgbansWs.cjs +2 -0
- package/dist/arrays-bgbansWs.cjs.map +1 -0
- package/dist/constants/bytes.cjs +1 -1
- package/dist/constants/bytes.cjs.map +1 -1
- package/dist/constants/bytes.d.cts +31 -1
- package/dist/constants/bytes.d.mts +31 -1
- package/dist/constants/bytes.mjs +1 -1
- package/dist/constants/bytes.mjs.map +1 -1
- package/dist/files-DzKYei0a.mjs +2 -0
- package/dist/files-DzKYei0a.mjs.map +1 -0
- package/dist/files-m1nnj5gT.cjs +2 -0
- package/dist/files-m1nnj5gT.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.mts +10 -8
- package/dist/index.mjs +1 -1
- package/dist/mime-types-BmvBrrZ7.cjs.map +1 -1
- package/dist/mime-types-D_K53zgk.mjs.map +1 -1
- package/dist/{mime-types-Bjt4NvnE.d.cts → mime-types-Dajfhq2c.d.cts} +58 -1
- package/dist/{mime-types-Bjt4NvnE.d.mts → mime-types-Dajfhq2c.d.mts} +58 -1
- package/dist/numbers-B_mptknO.cjs +2 -0
- package/dist/numbers-B_mptknO.cjs.map +1 -0
- package/dist/numbers-C2680fmA.d.cts +184 -0
- package/dist/numbers-C2680fmA.d.mts +184 -0
- package/dist/numbers-lJ6gwIpk.mjs +2 -0
- package/dist/numbers-lJ6gwIpk.mjs.map +1 -0
- package/dist/objects-VXf3mqE5.mjs +2 -0
- package/dist/objects-VXf3mqE5.mjs.map +1 -0
- package/dist/objects-fiFExjsf.d.cts +116 -0
- package/dist/objects-fiFExjsf.d.mts +116 -0
- package/dist/objects-wcO6hNA8.cjs +2 -0
- package/dist/objects-wcO6hNA8.cjs.map +1 -0
- package/dist/random-668tofPV.cjs +2 -0
- package/dist/random-668tofPV.cjs.map +1 -0
- package/dist/random-BqJDZAPb.d.cts +131 -0
- package/dist/random-BqJDZAPb.d.mts +131 -0
- package/dist/random-ihslkInn.mjs +2 -0
- package/dist/random-ihslkInn.mjs.map +1 -0
- package/dist/runtime-7fkN5_oL.d.cts +206 -0
- package/dist/runtime-7fkN5_oL.d.mts +206 -0
- package/dist/runtime-Bfs-yn_-.cjs +2 -0
- package/dist/runtime-Bfs-yn_-.cjs.map +1 -0
- package/dist/runtime-CE36Va0l.mjs +2 -0
- package/dist/runtime-CE36Va0l.mjs.map +1 -0
- package/dist/strings-CrzGdnZH.mjs +3 -0
- package/dist/strings-CrzGdnZH.mjs.map +1 -0
- package/dist/strings-_1vAPvzS.cjs +3 -0
- package/dist/strings-_1vAPvzS.cjs.map +1 -0
- package/dist/strings-jE1j-qqa.d.cts +213 -0
- package/dist/strings-jE1j-qqa.d.mts +213 -0
- package/dist/time-BrLHgSth.d.mts +68 -0
- package/dist/time-DmJNWZeL.mjs.map +1 -1
- package/dist/time-ufhllID1.d.cts +68 -0
- package/dist/time-yNkQSJnQ.cjs.map +1 -1
- package/dist/utils/arrays.cjs +1 -1
- package/dist/utils/arrays.d.cts +1 -1
- package/dist/utils/arrays.d.mts +1 -1
- package/dist/utils/arrays.mjs +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +187 -8
- package/dist/utils/index.d.mts +187 -8
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/mime-types.d.cts +1 -1
- package/dist/utils/mime-types.d.mts +1 -1
- package/dist/utils/numbers.cjs +1 -1
- package/dist/utils/numbers.d.cts +1 -1
- package/dist/utils/numbers.d.mts +1 -1
- package/dist/utils/numbers.mjs +1 -1
- package/dist/utils/objects.cjs +1 -1
- package/dist/utils/objects.d.cts +1 -1
- package/dist/utils/objects.d.mts +1 -1
- package/dist/utils/objects.mjs +1 -1
- package/dist/utils/random.cjs +1 -1
- package/dist/utils/random.d.cts +1 -1
- package/dist/utils/random.d.mts +1 -1
- package/dist/utils/random.mjs +1 -1
- package/dist/utils/runtime.cjs +1 -1
- package/dist/utils/runtime.d.cts +1 -1
- package/dist/utils/runtime.d.mts +1 -1
- package/dist/utils/runtime.mjs +1 -1
- package/dist/utils/strings.cjs +1 -1
- package/dist/utils/strings.d.cts +1 -1
- package/dist/utils/strings.d.mts +1 -1
- package/dist/utils/strings.mjs +1 -1
- package/dist/utils/time.d.cts +1 -1
- package/dist/utils/time.d.mts +1 -1
- package/package.json +2 -2
- package/dist/arrays-BkHBzTDO.mjs +0 -2
- package/dist/arrays-BkHBzTDO.mjs.map +0 -1
- package/dist/arrays-CElcW69H.d.cts +0 -43
- package/dist/arrays-CElcW69H.d.mts +0 -43
- package/dist/arrays-DaB1Xn47.cjs +0 -2
- package/dist/arrays-DaB1Xn47.cjs.map +0 -1
- package/dist/numbers-CtAqd3eH.d.cts +0 -49
- package/dist/numbers-CtAqd3eH.d.mts +0 -49
- package/dist/numbers-D2K-8sJL.mjs +0 -2
- package/dist/numbers-D2K-8sJL.mjs.map +0 -1
- package/dist/numbers-Du__2-8Y.cjs +0 -2
- package/dist/numbers-Du__2-8Y.cjs.map +0 -1
- package/dist/objects--cO_X3EV.mjs +0 -2
- package/dist/objects--cO_X3EV.mjs.map +0 -1
- package/dist/objects-CnGoVkh6.cjs +0 -2
- package/dist/objects-CnGoVkh6.cjs.map +0 -1
- package/dist/objects-cf8j7rS8.d.cts +0 -26
- package/dist/objects-cf8j7rS8.d.mts +0 -26
- package/dist/random-D1e1NTOt.cjs +0 -2
- package/dist/random-D1e1NTOt.cjs.map +0 -1
- package/dist/random-DbidGSrQ.mjs +0 -2
- package/dist/random-DbidGSrQ.mjs.map +0 -1
- package/dist/random-DpNyGGAZ.d.cts +0 -28
- package/dist/random-DpNyGGAZ.d.mts +0 -28
- package/dist/runtime-DY-8W6Jr.mjs +0 -2
- package/dist/runtime-DY-8W6Jr.mjs.map +0 -1
- package/dist/runtime-T8Kcf7Af.d.cts +0 -28
- package/dist/runtime-T8Kcf7Af.d.mts +0 -28
- package/dist/runtime-peVFcWot.cjs +0 -2
- package/dist/runtime-peVFcWot.cjs.map +0 -1
- package/dist/strings-B0BRwNX9.mjs +0 -3
- package/dist/strings-B0BRwNX9.mjs.map +0 -1
- package/dist/strings-DV446vv-.cjs +0 -3
- package/dist/strings-DV446vv-.cjs.map +0 -1
- package/dist/strings-DhPbrpq7.d.cts +0 -47
- package/dist/strings-DhPbrpq7.d.mts +0 -47
- package/dist/time-8KLG8kBO.d.cts +0 -29
- package/dist/time-D8Wfqzu6.d.mts +0 -29
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,9 +1,188 @@
|
|
|
1
|
-
export { a as ArrayUtils } from '../arrays-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { r as
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { a as ArrayUtils } from '../arrays-DvPJ1GeR.cjs';
|
|
2
|
+
import { statSync } from 'node:fs';
|
|
3
|
+
export { m as MimeTypeUtils } from '../mime-types-Dajfhq2c.cjs';
|
|
4
|
+
export { n as NumberUtils } from '../numbers-C2680fmA.cjs';
|
|
5
|
+
export { o as ObjectUtils } from '../objects-fiFExjsf.cjs';
|
|
6
|
+
export { r as RandomUtils } from '../random-BqJDZAPb.cjs';
|
|
7
|
+
export { r as RuntimeUtils } from '../runtime-7fkN5_oL.cjs';
|
|
8
|
+
export { s as StringUtils } from '../strings-jE1j-qqa.cjs';
|
|
9
|
+
export { t as TimeUtils } from '../time-ufhllID1.cjs';
|
|
9
10
|
import '../constants/time.cjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Regular expression pattern for parsing byte strings
|
|
14
|
+
*
|
|
15
|
+
* Matches strings in the format: `<number> <unit>` where:
|
|
16
|
+
* - `<number>` is an integer or decimal number
|
|
17
|
+
* - `<unit>` is an optional unit (b, kb, mb, gb, tb, pb, eb, zb, yb)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* '1024'.match(BYTE_STRING_PATTERN) // ['1024', '1024', undefined]
|
|
22
|
+
* '1.5 MB'.match(BYTE_STRING_PATTERN) // ['1.5 MB', '1.5', 'MB']
|
|
23
|
+
* '100 KB'.match(BYTE_STRING_PATTERN) // ['100 KB', '100', 'KB']
|
|
24
|
+
* '2.5gb'.match(BYTE_STRING_PATTERN) // ['2.5gb', '2.5', 'gb']
|
|
25
|
+
* '500'.match(BYTE_STRING_PATTERN) // ['500', '500', undefined]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const BYTE_STRING_PATTERN: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* Format bytes to human readable format
|
|
31
|
+
* @param bytes - Number of bytes
|
|
32
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
33
|
+
* @returns Formatted string (e.g., "1.5 MB")
|
|
34
|
+
*/
|
|
35
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse bytes from human readable format
|
|
38
|
+
* @param value - String value (e.g., "1.5 MB")
|
|
39
|
+
* @returns Number of bytes
|
|
40
|
+
*/
|
|
41
|
+
declare function parseBytes(value: string): number;
|
|
42
|
+
interface GetFilesOptions {
|
|
43
|
+
/**
|
|
44
|
+
* File extensions to include (e.g., ['.ts', '.js'])
|
|
45
|
+
* If not provided, all files are included
|
|
46
|
+
*/
|
|
47
|
+
extensions?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Whether to include dotfiles (default: false)
|
|
50
|
+
*/
|
|
51
|
+
includeDotFiles?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to search recursively (default: true)
|
|
54
|
+
*/
|
|
55
|
+
recursive?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum depth for recursive search (default: Infinity)
|
|
58
|
+
*/
|
|
59
|
+
maxDepth?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Directories to exclude from search
|
|
62
|
+
*/
|
|
63
|
+
excludeDirs?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Pattern to match file names (regex or string)
|
|
66
|
+
*/
|
|
67
|
+
pattern?: string | RegExp;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to return absolute paths (default: false)
|
|
70
|
+
*/
|
|
71
|
+
absolutePaths?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Custom filter function
|
|
74
|
+
*/
|
|
75
|
+
filter?: (filePath: string, stats: ReturnType<typeof statSync>) => boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get files from a directory with various filtering options
|
|
79
|
+
* @param dirPath - Directory path to search
|
|
80
|
+
* @param options - Options for filtering files
|
|
81
|
+
* @returns Array of file paths
|
|
82
|
+
*/
|
|
83
|
+
declare function getFiles(dirPath: string, options?: GetFilesOptions): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Get file extension including the dot (e.g., ".ts")
|
|
86
|
+
* @param filePath - File path
|
|
87
|
+
* @returns File extension
|
|
88
|
+
*/
|
|
89
|
+
declare function getExtension(filePath: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Get file name without parent directories, optionally including the extension
|
|
92
|
+
* @param filePath - File path
|
|
93
|
+
* @param includeExtension - Whether to include the file extension (default: true)
|
|
94
|
+
* @returns File name without directories (e.g., "index.ts" or "index" if includeExtension is false)
|
|
95
|
+
*/
|
|
96
|
+
declare function getBaseName(filePath: string, includeExtension?: boolean): string;
|
|
97
|
+
/**
|
|
98
|
+
* Get directory name from file path
|
|
99
|
+
* @param filePath - File path
|
|
100
|
+
* @returns Directory name
|
|
101
|
+
*/
|
|
102
|
+
declare function getDirName(filePath: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Parse file path into components
|
|
105
|
+
* @param filePath - File path
|
|
106
|
+
* @returns Parsed path object
|
|
107
|
+
*/
|
|
108
|
+
declare function parseFilePath(filePath: string): {
|
|
109
|
+
root: string;
|
|
110
|
+
dir: string;
|
|
111
|
+
base: string;
|
|
112
|
+
ext: string;
|
|
113
|
+
name: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Get file size in bytes
|
|
117
|
+
* @param filePath - File path
|
|
118
|
+
* @returns File size in bytes
|
|
119
|
+
*/
|
|
120
|
+
declare function getFileSize(filePath: string): number;
|
|
121
|
+
/**
|
|
122
|
+
* Get human readable file size
|
|
123
|
+
* @param filePath - File path
|
|
124
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
125
|
+
* @returns Formatted file size
|
|
126
|
+
*/
|
|
127
|
+
declare function getFileSizeFormatted(filePath: string, decimals?: number): string;
|
|
128
|
+
/**
|
|
129
|
+
* Check if path is a directory
|
|
130
|
+
* @param path - Path to check
|
|
131
|
+
* @returns True if path is a directory
|
|
132
|
+
*/
|
|
133
|
+
declare function isDirectory(path: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Check if path is a file
|
|
136
|
+
* @param path - Path to check
|
|
137
|
+
* @returns True if path is a file
|
|
138
|
+
*/
|
|
139
|
+
declare function isFile(path: string): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Check if file is a dotfile
|
|
142
|
+
* @param filePath - File path
|
|
143
|
+
* @returns True if file is a dotfile
|
|
144
|
+
*/
|
|
145
|
+
declare function isDotFile(filePath: string): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Normalize file extension (ensure it starts with a dot)
|
|
148
|
+
* @param ext - File extension
|
|
149
|
+
* @returns Normalized extension
|
|
150
|
+
*/
|
|
151
|
+
declare function normalizeExtension(ext: string): string;
|
|
152
|
+
/**
|
|
153
|
+
* Check if file has specific extension
|
|
154
|
+
* @param filePath - File path
|
|
155
|
+
* @param extensions - Extension or array of extensions to check
|
|
156
|
+
* @returns True if file has one of the extensions
|
|
157
|
+
*/
|
|
158
|
+
declare function hasExtension(filePath: string, extensions: string | string[]): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Group files by extension
|
|
161
|
+
* @param filePaths - Array of file paths
|
|
162
|
+
* @returns Object with extensions as keys and file paths as values
|
|
163
|
+
*/
|
|
164
|
+
declare function groupByExtension(filePaths: string[]): Record<string, string[]>;
|
|
165
|
+
|
|
166
|
+
declare const files_BYTE_STRING_PATTERN: typeof BYTE_STRING_PATTERN;
|
|
167
|
+
type files_GetFilesOptions = GetFilesOptions;
|
|
168
|
+
declare const files_formatBytes: typeof formatBytes;
|
|
169
|
+
declare const files_getBaseName: typeof getBaseName;
|
|
170
|
+
declare const files_getDirName: typeof getDirName;
|
|
171
|
+
declare const files_getExtension: typeof getExtension;
|
|
172
|
+
declare const files_getFileSize: typeof getFileSize;
|
|
173
|
+
declare const files_getFileSizeFormatted: typeof getFileSizeFormatted;
|
|
174
|
+
declare const files_getFiles: typeof getFiles;
|
|
175
|
+
declare const files_groupByExtension: typeof groupByExtension;
|
|
176
|
+
declare const files_hasExtension: typeof hasExtension;
|
|
177
|
+
declare const files_isDirectory: typeof isDirectory;
|
|
178
|
+
declare const files_isDotFile: typeof isDotFile;
|
|
179
|
+
declare const files_isFile: typeof isFile;
|
|
180
|
+
declare const files_normalizeExtension: typeof normalizeExtension;
|
|
181
|
+
declare const files_parseBytes: typeof parseBytes;
|
|
182
|
+
declare const files_parseFilePath: typeof parseFilePath;
|
|
183
|
+
declare namespace files {
|
|
184
|
+
export { files_BYTE_STRING_PATTERN as BYTE_STRING_PATTERN, files_formatBytes as formatBytes, files_getBaseName as getBaseName, files_getDirName as getDirName, files_getExtension as getExtension, files_getFileSize as getFileSize, files_getFileSizeFormatted as getFileSizeFormatted, files_getFiles as getFiles, files_groupByExtension as groupByExtension, files_hasExtension as hasExtension, files_isDirectory as isDirectory, files_isDotFile as isDotFile, files_isFile as isFile, files_normalizeExtension as normalizeExtension, files_parseBytes as parseBytes, files_parseFilePath as parseFilePath };
|
|
185
|
+
export type { files_GetFilesOptions as GetFilesOptions };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { files as FileUtils };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,9 +1,188 @@
|
|
|
1
|
-
export { a as ArrayUtils } from '../arrays-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { r as
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
1
|
+
export { a as ArrayUtils } from '../arrays-DvPJ1GeR.mjs';
|
|
2
|
+
import { statSync } from 'node:fs';
|
|
3
|
+
export { m as MimeTypeUtils } from '../mime-types-Dajfhq2c.mjs';
|
|
4
|
+
export { n as NumberUtils } from '../numbers-C2680fmA.mjs';
|
|
5
|
+
export { o as ObjectUtils } from '../objects-fiFExjsf.mjs';
|
|
6
|
+
export { r as RandomUtils } from '../random-BqJDZAPb.mjs';
|
|
7
|
+
export { r as RuntimeUtils } from '../runtime-7fkN5_oL.mjs';
|
|
8
|
+
export { s as StringUtils } from '../strings-jE1j-qqa.mjs';
|
|
9
|
+
export { t as TimeUtils } from '../time-BrLHgSth.mjs';
|
|
9
10
|
import '../constants/time.mjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Regular expression pattern for parsing byte strings
|
|
14
|
+
*
|
|
15
|
+
* Matches strings in the format: `<number> <unit>` where:
|
|
16
|
+
* - `<number>` is an integer or decimal number
|
|
17
|
+
* - `<unit>` is an optional unit (b, kb, mb, gb, tb, pb, eb, zb, yb)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* '1024'.match(BYTE_STRING_PATTERN) // ['1024', '1024', undefined]
|
|
22
|
+
* '1.5 MB'.match(BYTE_STRING_PATTERN) // ['1.5 MB', '1.5', 'MB']
|
|
23
|
+
* '100 KB'.match(BYTE_STRING_PATTERN) // ['100 KB', '100', 'KB']
|
|
24
|
+
* '2.5gb'.match(BYTE_STRING_PATTERN) // ['2.5gb', '2.5', 'gb']
|
|
25
|
+
* '500'.match(BYTE_STRING_PATTERN) // ['500', '500', undefined]
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const BYTE_STRING_PATTERN: RegExp;
|
|
29
|
+
/**
|
|
30
|
+
* Format bytes to human readable format
|
|
31
|
+
* @param bytes - Number of bytes
|
|
32
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
33
|
+
* @returns Formatted string (e.g., "1.5 MB")
|
|
34
|
+
*/
|
|
35
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse bytes from human readable format
|
|
38
|
+
* @param value - String value (e.g., "1.5 MB")
|
|
39
|
+
* @returns Number of bytes
|
|
40
|
+
*/
|
|
41
|
+
declare function parseBytes(value: string): number;
|
|
42
|
+
interface GetFilesOptions {
|
|
43
|
+
/**
|
|
44
|
+
* File extensions to include (e.g., ['.ts', '.js'])
|
|
45
|
+
* If not provided, all files are included
|
|
46
|
+
*/
|
|
47
|
+
extensions?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Whether to include dotfiles (default: false)
|
|
50
|
+
*/
|
|
51
|
+
includeDotFiles?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether to search recursively (default: true)
|
|
54
|
+
*/
|
|
55
|
+
recursive?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum depth for recursive search (default: Infinity)
|
|
58
|
+
*/
|
|
59
|
+
maxDepth?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Directories to exclude from search
|
|
62
|
+
*/
|
|
63
|
+
excludeDirs?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Pattern to match file names (regex or string)
|
|
66
|
+
*/
|
|
67
|
+
pattern?: string | RegExp;
|
|
68
|
+
/**
|
|
69
|
+
* Whether to return absolute paths (default: false)
|
|
70
|
+
*/
|
|
71
|
+
absolutePaths?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Custom filter function
|
|
74
|
+
*/
|
|
75
|
+
filter?: (filePath: string, stats: ReturnType<typeof statSync>) => boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get files from a directory with various filtering options
|
|
79
|
+
* @param dirPath - Directory path to search
|
|
80
|
+
* @param options - Options for filtering files
|
|
81
|
+
* @returns Array of file paths
|
|
82
|
+
*/
|
|
83
|
+
declare function getFiles(dirPath: string, options?: GetFilesOptions): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Get file extension including the dot (e.g., ".ts")
|
|
86
|
+
* @param filePath - File path
|
|
87
|
+
* @returns File extension
|
|
88
|
+
*/
|
|
89
|
+
declare function getExtension(filePath: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* Get file name without parent directories, optionally including the extension
|
|
92
|
+
* @param filePath - File path
|
|
93
|
+
* @param includeExtension - Whether to include the file extension (default: true)
|
|
94
|
+
* @returns File name without directories (e.g., "index.ts" or "index" if includeExtension is false)
|
|
95
|
+
*/
|
|
96
|
+
declare function getBaseName(filePath: string, includeExtension?: boolean): string;
|
|
97
|
+
/**
|
|
98
|
+
* Get directory name from file path
|
|
99
|
+
* @param filePath - File path
|
|
100
|
+
* @returns Directory name
|
|
101
|
+
*/
|
|
102
|
+
declare function getDirName(filePath: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Parse file path into components
|
|
105
|
+
* @param filePath - File path
|
|
106
|
+
* @returns Parsed path object
|
|
107
|
+
*/
|
|
108
|
+
declare function parseFilePath(filePath: string): {
|
|
109
|
+
root: string;
|
|
110
|
+
dir: string;
|
|
111
|
+
base: string;
|
|
112
|
+
ext: string;
|
|
113
|
+
name: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Get file size in bytes
|
|
117
|
+
* @param filePath - File path
|
|
118
|
+
* @returns File size in bytes
|
|
119
|
+
*/
|
|
120
|
+
declare function getFileSize(filePath: string): number;
|
|
121
|
+
/**
|
|
122
|
+
* Get human readable file size
|
|
123
|
+
* @param filePath - File path
|
|
124
|
+
* @param decimals - Number of decimal places (default: 2)
|
|
125
|
+
* @returns Formatted file size
|
|
126
|
+
*/
|
|
127
|
+
declare function getFileSizeFormatted(filePath: string, decimals?: number): string;
|
|
128
|
+
/**
|
|
129
|
+
* Check if path is a directory
|
|
130
|
+
* @param path - Path to check
|
|
131
|
+
* @returns True if path is a directory
|
|
132
|
+
*/
|
|
133
|
+
declare function isDirectory(path: string): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Check if path is a file
|
|
136
|
+
* @param path - Path to check
|
|
137
|
+
* @returns True if path is a file
|
|
138
|
+
*/
|
|
139
|
+
declare function isFile(path: string): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Check if file is a dotfile
|
|
142
|
+
* @param filePath - File path
|
|
143
|
+
* @returns True if file is a dotfile
|
|
144
|
+
*/
|
|
145
|
+
declare function isDotFile(filePath: string): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Normalize file extension (ensure it starts with a dot)
|
|
148
|
+
* @param ext - File extension
|
|
149
|
+
* @returns Normalized extension
|
|
150
|
+
*/
|
|
151
|
+
declare function normalizeExtension(ext: string): string;
|
|
152
|
+
/**
|
|
153
|
+
* Check if file has specific extension
|
|
154
|
+
* @param filePath - File path
|
|
155
|
+
* @param extensions - Extension or array of extensions to check
|
|
156
|
+
* @returns True if file has one of the extensions
|
|
157
|
+
*/
|
|
158
|
+
declare function hasExtension(filePath: string, extensions: string | string[]): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Group files by extension
|
|
161
|
+
* @param filePaths - Array of file paths
|
|
162
|
+
* @returns Object with extensions as keys and file paths as values
|
|
163
|
+
*/
|
|
164
|
+
declare function groupByExtension(filePaths: string[]): Record<string, string[]>;
|
|
165
|
+
|
|
166
|
+
declare const files_BYTE_STRING_PATTERN: typeof BYTE_STRING_PATTERN;
|
|
167
|
+
type files_GetFilesOptions = GetFilesOptions;
|
|
168
|
+
declare const files_formatBytes: typeof formatBytes;
|
|
169
|
+
declare const files_getBaseName: typeof getBaseName;
|
|
170
|
+
declare const files_getDirName: typeof getDirName;
|
|
171
|
+
declare const files_getExtension: typeof getExtension;
|
|
172
|
+
declare const files_getFileSize: typeof getFileSize;
|
|
173
|
+
declare const files_getFileSizeFormatted: typeof getFileSizeFormatted;
|
|
174
|
+
declare const files_getFiles: typeof getFiles;
|
|
175
|
+
declare const files_groupByExtension: typeof groupByExtension;
|
|
176
|
+
declare const files_hasExtension: typeof hasExtension;
|
|
177
|
+
declare const files_isDirectory: typeof isDirectory;
|
|
178
|
+
declare const files_isDotFile: typeof isDotFile;
|
|
179
|
+
declare const files_isFile: typeof isFile;
|
|
180
|
+
declare const files_normalizeExtension: typeof normalizeExtension;
|
|
181
|
+
declare const files_parseBytes: typeof parseBytes;
|
|
182
|
+
declare const files_parseFilePath: typeof parseFilePath;
|
|
183
|
+
declare namespace files {
|
|
184
|
+
export { files_BYTE_STRING_PATTERN as BYTE_STRING_PATTERN, files_formatBytes as formatBytes, files_getBaseName as getBaseName, files_getDirName as getDirName, files_getExtension as getExtension, files_getFileSize as getFileSize, files_getFileSizeFormatted as getFileSizeFormatted, files_getFiles as getFiles, files_groupByExtension as groupByExtension, files_hasExtension as hasExtension, files_isDirectory as isDirectory, files_isDotFile as isDotFile, files_isFile as isFile, files_normalizeExtension as normalizeExtension, files_parseBytes as parseBytes, files_parseFilePath as parseFilePath };
|
|
185
|
+
export type { files_GetFilesOptions as GetFilesOptions };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { files as FileUtils };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as e}from"../arrays-6DA6GfsQ.mjs";import{f as a}from"../files-DzKYei0a.mjs";import{m as l}from"../mime-types-D_K53zgk.mjs";import{n as U}from"../numbers-lJ6gwIpk.mjs";import{o as b}from"../objects-VXf3mqE5.mjs";import{r as y}from"../random-ihslkInn.mjs";import{r as T}from"../runtime-CE36Va0l.mjs";import{s as d}from"../strings-CrzGdnZH.mjs";import{t as j}from"../time-DmJNWZeL.mjs";import"node:fs";import"node:path";import"../constants/bytes.mjs";import"../constants/time.mjs";export{e as ArrayUtils,a as FileUtils,l as MimeTypeUtils,U as NumberUtils,b as ObjectUtils,y as RandomUtils,T as RuntimeUtils,d as StringUtils,j as TimeUtils};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { M as MimeKind, a as MimeKindWithSafe, c as archiveMimeTypes, b as audioMimeTypes, d as documentMimeTypes, g as getInputAccept, i as imageMimeTypes, k as inlineContentDispositionMimeTypes, f as isAllowedMimeType, h as isInlineContentDisposition, e as mimeTypeMap, j as mimeTypeResolver, s as safeMimeTypes, v as videoMimeTypes } from '../mime-types-
|
|
1
|
+
export { M as MimeKind, a as MimeKindWithSafe, c as archiveMimeTypes, b as audioMimeTypes, d as documentMimeTypes, g as getInputAccept, i as imageMimeTypes, k as inlineContentDispositionMimeTypes, f as isAllowedMimeType, h as isInlineContentDisposition, e as mimeTypeMap, j as mimeTypeResolver, s as safeMimeTypes, v as videoMimeTypes } from '../mime-types-Dajfhq2c.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { M as MimeKind, a as MimeKindWithSafe, c as archiveMimeTypes, b as audioMimeTypes, d as documentMimeTypes, g as getInputAccept, i as imageMimeTypes, k as inlineContentDispositionMimeTypes, f as isAllowedMimeType, h as isInlineContentDisposition, e as mimeTypeMap, j as mimeTypeResolver, s as safeMimeTypes, v as videoMimeTypes } from '../mime-types-
|
|
1
|
+
export { M as MimeKind, a as MimeKindWithSafe, c as archiveMimeTypes, b as audioMimeTypes, d as documentMimeTypes, g as getInputAccept, i as imageMimeTypes, k as inlineContentDispositionMimeTypes, f as isAllowedMimeType, h as isInlineContentDisposition, e as mimeTypeMap, j as mimeTypeResolver, s as safeMimeTypes, v as videoMimeTypes } from '../mime-types-Dajfhq2c.mjs';
|
package/dist/utils/numbers.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=require("../numbers-
|
|
1
|
+
"use strict";var a=require("../numbers-B_mptknO.cjs");exports.INT32_MAX=a.INT32_MAX,exports.INT32_MIN=a.INT32_MIN,exports.INT64_MAX=a.INT64_MAX,exports.INT64_MIN=a.INT64_MIN,exports.average=a.average,exports.bigIntSerializationHelper=a.bigIntSerializationHelper,exports.calculateMean=a.calculateMean,exports.calculateMedian=a.calculateMedian,exports.calculateStandardDeviation=a.calculateStandardDeviation,exports.calculateVariance=a.calculateVariance,exports.clamp=a.clamp,exports.inRange=a.inRange,exports.isEven=a.isEven,exports.isFloat=a.isFloat,exports.isInt=a.isInt,exports.isOdd=a.isOdd,exports.lerp=a.lerp,exports.percentage=a.percentage,exports.percentageOf=a.percentageOf,exports.roundTo=a.roundTo,exports.sum=a.sum;
|
|
2
2
|
//# sourceMappingURL=numbers.cjs.map
|
package/dist/utils/numbers.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { I as INT32_MAX,
|
|
1
|
+
export { I as INT32_MAX, h as INT32_MIN, j as INT64_MAX, k as INT64_MIN, g as average, u as bigIntSerializationHelper, m as calculateMean, o as calculateMedian, t as calculateStandardDeviation, q as calculateVariance, d as clamp, f as inRange, b as isEven, a as isFloat, i as isInt, c as isOdd, l as lerp, p as percentage, e as percentageOf, r as roundTo, s as sum } from '../numbers-C2680fmA.cjs';
|
package/dist/utils/numbers.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { I as INT32_MAX,
|
|
1
|
+
export { I as INT32_MAX, h as INT32_MIN, j as INT64_MAX, k as INT64_MIN, g as average, u as bigIntSerializationHelper, m as calculateMean, o as calculateMedian, t as calculateStandardDeviation, q as calculateVariance, d as clamp, f as inRange, b as isEven, a as isFloat, i as isInt, c as isOdd, l as lerp, p as percentage, e as percentageOf, r as roundTo, s as sum } from '../numbers-C2680fmA.mjs';
|
package/dist/utils/numbers.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as e,
|
|
1
|
+
import{I as e,h as i,j as l,k as n,g as t,u as c,m as r,o as I,t as o,q as d,d as p,f as u,b as g,a as M,i as N,c as T,l as m,p as _,e as f,r as v,s as b}from"../numbers-lJ6gwIpk.mjs";export{e as INT32_MAX,i as INT32_MIN,l as INT64_MAX,n as INT64_MIN,t as average,c as bigIntSerializationHelper,r as calculateMean,I as calculateMedian,o as calculateStandardDeviation,d as calculateVariance,p as clamp,u as inRange,g as isEven,M as isFloat,N as isInt,T as isOdd,m as lerp,_ as percentage,f as percentageOf,v as roundTo,b as sum};
|
|
2
2
|
//# sourceMappingURL=numbers.mjs.map
|
package/dist/utils/objects.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../objects-
|
|
1
|
+
"use strict";var e=require("../objects-wcO6hNA8.cjs");exports.deepClone=e.deepClone,exports.deepMerge=e.deepMerge,exports.flattenObject=e.flattenObject,exports.getNestedValue=e.getNestedValue,exports.isEmptyObject=e.isEmptyObject,exports.isObject=e.isObject,exports.mapKeys=e.mapKeys,exports.mapValues=e.mapValues,exports.objectKeys=e.objectKeys,exports.omit=e.omit,exports.pick=e.pick,exports.setNestedValue=e.setNestedValue;
|
|
2
2
|
//# sourceMappingURL=objects.cjs.map
|
package/dist/utils/objects.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { G as GenericObject,
|
|
1
|
+
export { G as GenericObject, d as deepClone, b as deepMerge, f as flattenObject, g as getNestedValue, a as isEmptyObject, i as isObject, h as mapKeys, m as mapValues, e as objectKeys, c as omit, p as pick, s as setNestedValue } from '../objects-fiFExjsf.cjs';
|
package/dist/utils/objects.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { G as GenericObject,
|
|
1
|
+
export { G as GenericObject, d as deepClone, b as deepMerge, f as flattenObject, g as getNestedValue, a as isEmptyObject, i as isObject, h as mapKeys, m as mapValues, e as objectKeys, c as omit, p as pick, s as setNestedValue } from '../objects-fiFExjsf.mjs';
|
package/dist/utils/objects.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as a,b as t,g as
|
|
1
|
+
import{d as a,b as t,f as p,g as c,a as m,i as b,h as d,m as i,e as l,c as o,p as j,s as f}from"../objects-VXf3mqE5.mjs";export{a as deepClone,t as deepMerge,p as flattenObject,c as getNestedValue,m as isEmptyObject,b as isObject,d as mapKeys,i as mapValues,l as objectKeys,o as omit,j as pick,f as setNestedValue};
|
|
2
2
|
//# sourceMappingURL=objects.mjs.map
|
package/dist/utils/random.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var a=require("../random-
|
|
1
|
+
"use strict";var a=require("../random-668tofPV.cjs");exports.randomBoolean=a.randomBoolean,exports.randomColor=a.randomColor,exports.randomDate=a.randomDate,exports.randomEnum=a.randomEnum,exports.randomFloat=a.randomFloat,exports.randomHex=a.randomHex,exports.randomInt=a.randomInt,exports.randomItem=a.randomItem,exports.randomKey=a.randomKey,exports.randomString=a.randomString,exports.randomUUID=a.randomUUID,exports.randomValue=a.randomValue,exports.sample=a.sample,exports.weightedRandom=a.weightedRandom;
|
|
2
2
|
//# sourceMappingURL=random.cjs.map
|
package/dist/utils/random.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { R as RandomStringOptions, f as randomBoolean, b as randomFloat, a as randomInt, c as randomItem, d as randomKey, g as randomString, e as randomValue } from '../random-
|
|
1
|
+
export { R as RandomStringOptions, f as randomBoolean, k as randomColor, l as randomDate, j as randomEnum, b as randomFloat, h as randomHex, a as randomInt, c as randomItem, d as randomKey, g as randomString, i as randomUUID, e as randomValue, s as sample, w as weightedRandom } from '../random-BqJDZAPb.cjs';
|
package/dist/utils/random.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { R as RandomStringOptions, f as randomBoolean, b as randomFloat, a as randomInt, c as randomItem, d as randomKey, g as randomString, e as randomValue } from '../random-
|
|
1
|
+
export { R as RandomStringOptions, f as randomBoolean, k as randomColor, l as randomDate, j as randomEnum, b as randomFloat, h as randomHex, a as randomInt, c as randomItem, d as randomKey, g as randomString, i as randomUUID, e as randomValue, s as sample, w as weightedRandom } from '../random-BqJDZAPb.mjs';
|
package/dist/utils/random.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as n,
|
|
1
|
+
import{f as m,k as n,l as r,j as s,b as d,h as e,a as t,c as l,d as g,g as i,i as I,e as f,s as h,w as p}from"../random-ihslkInn.mjs";export{m as randomBoolean,n as randomColor,r as randomDate,s as randomEnum,d as randomFloat,e as randomHex,t as randomInt,l as randomItem,g as randomKey,i as randomString,I as randomUUID,f as randomValue,h as sample,p as weightedRandom};
|
|
2
2
|
//# sourceMappingURL=random.mjs.map
|
package/dist/utils/runtime.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require("../numbers-
|
|
1
|
+
"use strict";require("../numbers-B_mptknO.cjs"),require("../constants/time.cjs");var e=require("../runtime-Bfs-yn_-.cjs");exports.awaitOrTimeout=e.awaitOrTimeout,exports.batchMap=e.batchMap,exports.batchMapWithRetry=e.batchMapWithRetry,exports.batchProcess=e.batchProcess,exports.executeWithConcurrency=e.executeWithConcurrency,exports.processBatches=e.processBatches,exports.safeSetAsyncInterval=e.safeSetAsyncInterval,exports.safeSetInterval=e.safeSetInterval,exports.safeSetTimeout=e.safeSetTimeout,exports.sleep=e.sleep,exports.sleepUntil=e.sleepUntil,exports.sleepUntilOrTimeout=e.sleepUntilOrTimeout;
|
|
2
2
|
//# sourceMappingURL=runtime.cjs.map
|
package/dist/utils/runtime.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as awaitOrTimeout, f as safeSetAsyncInterval, e as safeSetInterval, d as safeSetTimeout, s as sleep, a as sleepUntil, b as sleepUntilOrTimeout } from '../runtime-
|
|
1
|
+
export { k as BatchProcessOptions, l as BatchProcessWithRetryOptions, B as BatchResult, c as awaitOrTimeout, i as batchMap, j as batchMapWithRetry, h as batchProcess, g as executeWithConcurrency, p as processBatches, f as safeSetAsyncInterval, e as safeSetInterval, d as safeSetTimeout, s as sleep, a as sleepUntil, b as sleepUntilOrTimeout } from '../runtime-7fkN5_oL.cjs';
|
package/dist/utils/runtime.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as awaitOrTimeout, f as safeSetAsyncInterval, e as safeSetInterval, d as safeSetTimeout, s as sleep, a as sleepUntil, b as sleepUntilOrTimeout } from '../runtime-
|
|
1
|
+
export { k as BatchProcessOptions, l as BatchProcessWithRetryOptions, B as BatchResult, c as awaitOrTimeout, i as batchMap, j as batchMapWithRetry, h as batchProcess, g as executeWithConcurrency, p as processBatches, f as safeSetAsyncInterval, e as safeSetInterval, d as safeSetTimeout, s as sleep, a as sleepUntil, b as sleepUntilOrTimeout } from '../runtime-7fkN5_oL.mjs';
|
package/dist/utils/runtime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../numbers-
|
|
1
|
+
import"../numbers-lJ6gwIpk.mjs";import"../constants/time.mjs";import{c as r,i as c,j as i,h as o,g as p,p as h,f as l,e as n,d as m,s as f,a as u,b}from"../runtime-CE36Va0l.mjs";export{r as awaitOrTimeout,c as batchMap,i as batchMapWithRetry,o as batchProcess,p as executeWithConcurrency,h as processBatches,l as safeSetAsyncInterval,n as safeSetInterval,m as safeSetTimeout,f as sleep,u as sleepUntil,b as sleepUntilOrTimeout};
|
|
2
2
|
//# sourceMappingURL=runtime.mjs.map
|
package/dist/utils/strings.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("../strings-_1vAPvzS.cjs");exports.camelCase=e.camelCase,exports.capitalize=e.capitalize,exports.capitalizeWords=e.capitalizeWords,exports.countOccurrences=e.countOccurrences,exports.displayArray=e.displayArray,exports.escapeHtml=e.escapeHtml,exports.isAlpha=e.isAlpha,exports.isAlphanumeric=e.isAlphanumeric,exports.isUrl=e.isUrl,exports.kebabCase=e.kebabCase,exports.pad=e.pad,exports.pascalCase=e.pascalCase,exports.pluralize=e.pluralize,exports.replaceTags=e.replaceTags,exports.reverse=e.reverse,exports.slugify=e.slugify,exports.snakeCase=e.snakeCase,exports.splitOnUppercase=e.splitOnUppercase,exports.stringifyArray=e.stringifyArray,exports.titleCase=e.titleCase,exports.truncate=e.truncate,exports.unescapeHtml=e.unescapeHtml;
|
|
2
2
|
//# sourceMappingURL=strings.cjs.map
|
package/dist/utils/strings.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as StringifyArrayOptions,
|
|
1
|
+
export { S as StringifyArrayOptions, n as camelCase, c as capitalize, a as capitalizeWords, d as countOccurrences, h as displayArray, e as escapeHtml, i as isAlpha, f as isAlphanumeric, w as isUrl, m as kebabCase, p as pad, o as pascalCase, j as pluralize, v as replaceTags, r as reverse, b as slugify, k as snakeCase, q as splitOnUppercase, g as stringifyArray, l as titleCase, t as truncate, u as unescapeHtml } from '../strings-jE1j-qqa.cjs';
|
package/dist/utils/strings.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as StringifyArrayOptions,
|
|
1
|
+
export { S as StringifyArrayOptions, n as camelCase, c as capitalize, a as capitalizeWords, d as countOccurrences, h as displayArray, e as escapeHtml, i as isAlpha, f as isAlphanumeric, w as isUrl, m as kebabCase, p as pad, o as pascalCase, j as pluralize, v as replaceTags, r as reverse, b as slugify, k as snakeCase, q as splitOnUppercase, g as stringifyArray, l as titleCase, t as truncate, u as unescapeHtml } from '../strings-jE1j-qqa.mjs';
|
package/dist/utils/strings.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,
|
|
1
|
+
import{n as e,c as r,a as l,d as i,h as p,e as c,i as t,f as n,w as u,m,p as o,o as y,j as C,v as d,r as f,b as g,k as A,q as b,g as h,l as k,t as z,u as v}from"../strings-CrzGdnZH.mjs";export{e as camelCase,r as capitalize,l as capitalizeWords,i as countOccurrences,p as displayArray,c as escapeHtml,t as isAlpha,n as isAlphanumeric,u as isUrl,m as kebabCase,o as pad,y as pascalCase,C as pluralize,d as replaceTags,f as reverse,g as slugify,A as snakeCase,b as splitOnUppercase,h as stringifyArray,k as titleCase,z as truncate,v as unescapeHtml};
|
|
2
2
|
//# sourceMappingURL=strings.mjs.map
|
package/dist/utils/time.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { TimeMagic } from '../constants/time.cjs';
|
|
2
|
-
export { c as bigIntDurationToHumanReadable, b as hrTimeToMs, h as humanReadableMs, o as occurrencesPerInterval, u as unix, a as unixNow } from '../time-
|
|
2
|
+
export { c as bigIntDurationToHumanReadable, b as hrTimeToMs, h as humanReadableMs, o as occurrencesPerInterval, u as unix, a as unixNow } from '../time-ufhllID1.cjs';
|
package/dist/utils/time.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { TimeMagic } from '../constants/time.mjs';
|
|
2
|
-
export { c as bigIntDurationToHumanReadable, b as hrTimeToMs, h as humanReadableMs, o as occurrencesPerInterval, u as unix, a as unixNow } from '../time-
|
|
2
|
+
export { c as bigIntDurationToHumanReadable, b as hrTimeToMs, h as humanReadableMs, o as occurrencesPerInterval, u as unix, a as unixNow } from '../time-BrLHgSth.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-oss/common",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
"@types/qs": "^6.14.0",
|
|
217
217
|
"qs": "^6.14.1",
|
|
218
218
|
"zod": "^4.3.6",
|
|
219
|
-
"@md-oss/config": "^0.1.
|
|
219
|
+
"@md-oss/config": "^0.1.7"
|
|
220
220
|
},
|
|
221
221
|
"devDependencies": {
|
|
222
222
|
"@types/node": "^25.0.9",
|
package/dist/arrays-BkHBzTDO.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var b=Object.defineProperty;var o=(e,t)=>b(e,"name",{value:t,configurable:!0});import{t as d}from"./strings-B0BRwNX9.mjs";const i=o((e,t)=>{const r=[];if(t<=0)throw new Error("Chunk size must be greater than 0");for(let n=0;n<e.length;n+=t)r.push(e.slice(n,t+n));return r},"chunk"),u=o((e,t={})=>{let r;const{maxItems:n=-1,maxLength:a=-1,emptyOutput:g="None",joinString:c=", "}=t,f=o(s=>a===-1?s:s.length>a?d(s,a):s,"withMaxLength");if(e.length===0)r=g;else if(e.length<=n||n===-1)r=e.join(c);else{const s=e.slice(0,n),p=`and ${e.length-n} more...`;r=`${s.join(c)}, ${p}`}return f(r)},"join"),l=o(e=>e.every(t=>typeof t=="string"),"isStringArray"),y=o(e=>e.every(t=>typeof t=="number"),"isNumberArray"),h=o(e=>e.every(t=>typeof t=="boolean"),"isBooleanArray"),m=o(e=>e.every(t=>typeof t=="object"&&t!==null),"isObjectArray");var j=Object.freeze({__proto__:null,chunk:i,isBooleanArray:h,isNumberArray:y,isObjectArray:m,isStringArray:l,join:u});export{j as a,y as b,i as c,h as d,m as e,l as i,u as j};
|
|
2
|
-
//# sourceMappingURL=arrays-BkHBzTDO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arrays-BkHBzTDO.mjs","sources":["../src/utils/arrays.ts"],"sourcesContent":["import { truncate } from './strings';\n\nconst chunk = <T>(arr: T[], size: number): T[][] => {\n\tconst result = [];\n\n\tif (size <= 0) {\n\t\tthrow new Error('Chunk size must be greater than 0');\n\t}\n\n\tfor (let i = 0; i < arr.length; i += size) {\n\t\tresult.push(arr.slice(i, size + i));\n\t}\n\n\treturn result;\n};\n\nconst join = <T extends unknown[]>(\n\tarr: T,\n\toptions: JoinOptions = {}\n): string => {\n\tlet output: string;\n\tconst {\n\t\tmaxItems = -1,\n\t\tmaxLength = -1,\n\t\temptyOutput = 'None',\n\t\tjoinString = ', ',\n\t} = options;\n\n\tconst withMaxLength = (str: string) => {\n\t\tif (maxLength === -1) return str;\n\t\treturn str.length > maxLength ? truncate(str, maxLength) : str;\n\t};\n\n\tif (arr.length === 0) output = emptyOutput;\n\telse if (arr.length <= maxItems || maxItems === -1) {\n\t\toutput = arr.join(joinString);\n\t} else {\n\t\tconst includedItems = arr.slice(0, maxItems);\n\t\tconst excludedItemsCount = arr.length - maxItems;\n\t\tconst excludedItemsMessage = `and ${excludedItemsCount} more...`;\n\n\t\toutput = `${includedItems.join(joinString)}, ${excludedItemsMessage}`;\n\t}\n\n\treturn withMaxLength(output);\n};\n\nconst isStringArray = (arr: unknown[]): arr is string[] =>\n\tarr.every((item) => typeof item === 'string');\nconst isNumberArray = (arr: unknown[]): arr is number[] =>\n\tarr.every((item) => typeof item === 'number');\nconst isBooleanArray = (arr: unknown[]): arr is boolean[] =>\n\tarr.every((item) => typeof item === 'boolean');\nconst isObjectArray = (arr: unknown[]): arr is Record<string, unknown>[] =>\n\tarr.every((item) => typeof item === 'object' && item !== null);\n\ntype JoinOptions = {\n\t/**\n\t * The string to join the items with\n\t * @default ', '\n\t */\n\tjoinString?: string;\n\t/**\n\t * The maximum number of (array) items to include\n\t * @default -1\n\t */\n\tmaxItems?: number;\n\t/**\n\t * The maximum length of the joined/final string\n\t * @default -1\n\t */\n\tmaxLength?: number;\n\t/**\n\t * The string that is returned if the input array is empty\n\t * @default 'None'\n\t */\n\temptyOutput?: string;\n};\n\nexport {\n\tchunk,\n\tjoin,\n\tisStringArray,\n\tisNumberArray,\n\tisBooleanArray,\n\tisObjectArray,\n\ttype JoinOptions,\n};\n"],"names":["chunk","__name","arr","size","result","i","join","options","output","maxItems","maxLength","emptyOutput","joinString","withMaxLength","str","truncate","includedItems","excludedItemsMessage","isStringArray","item","isNumberArray","isBooleanArray","isObjectArray"],"mappings":"0HAEA,MAAMA,EAAQC,EAAA,CAAIC,EAAUC,IAAwB,CACnD,MAAMC,EAAS,CAAA,EAEf,GAAID,GAAQ,EACX,MAAM,IAAI,MAAM,mCAAmC,EAGpD,QAASE,EAAI,EAAGA,EAAIH,EAAI,OAAQG,GAAKF,EACpCC,EAAO,KAAKF,EAAI,MAAMG,EAAGF,EAAOE,CAAC,CAAC,EAGnC,OAAOD,CACR,EAZc,SAcRE,EAAOL,EAAA,CACZC,EACAK,EAAuB,KACX,CACZ,IAAIC,EACJ,KAAM,CACL,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,YAAAC,EAAc,OACd,WAAAC,EAAa,IAAA,EACVL,EAEEM,EAAgBZ,EAACa,GAClBJ,IAAc,GAAWI,EACtBA,EAAI,OAASJ,EAAYK,EAASD,EAAKJ,CAAS,EAAII,EAFtC,iBAKtB,GAAIZ,EAAI,SAAW,EAAGM,EAASG,UACtBT,EAAI,QAAUO,GAAYA,IAAa,GAC/CD,EAASN,EAAI,KAAKU,CAAU,MACtB,CACN,MAAMI,EAAgBd,EAAI,MAAM,EAAGO,CAAQ,EAErCQ,EAAuB,OADFf,EAAI,OAASO,CACc,WAEtDD,EAAS,GAAGQ,EAAc,KAAKJ,CAAU,CAAC,KAAKK,CAAoB,EACpE,CAEA,OAAOJ,EAAcL,CAAM,CAC5B,EA7Ba,QA+BPU,EAAgBjB,EAACC,GACtBA,EAAI,MAAOiB,GAAS,OAAOA,GAAS,QAAQ,EADvB,iBAEhBC,EAAgBnB,EAACC,GACtBA,EAAI,MAAOiB,GAAS,OAAOA,GAAS,QAAQ,EADvB,iBAEhBE,EAAiBpB,EAACC,GACvBA,EAAI,MAAOiB,GAAS,OAAOA,GAAS,SAAS,EADvB,kBAEjBG,EAAgBrB,EAACC,GACtBA,EAAI,MAAOiB,GAAS,OAAOA,GAAS,UAAYA,IAAS,IAAI,EADxC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
declare const chunk: <T>(arr: T[], size: number) => T[][];
|
|
2
|
-
declare const join: <T extends unknown[]>(arr: T, options?: JoinOptions) => string;
|
|
3
|
-
declare const isStringArray: (arr: unknown[]) => arr is string[];
|
|
4
|
-
declare const isNumberArray: (arr: unknown[]) => arr is number[];
|
|
5
|
-
declare const isBooleanArray: (arr: unknown[]) => arr is boolean[];
|
|
6
|
-
declare const isObjectArray: (arr: unknown[]) => arr is Record<string, unknown>[];
|
|
7
|
-
type JoinOptions = {
|
|
8
|
-
/**
|
|
9
|
-
* The string to join the items with
|
|
10
|
-
* @default ', '
|
|
11
|
-
*/
|
|
12
|
-
joinString?: string;
|
|
13
|
-
/**
|
|
14
|
-
* The maximum number of (array) items to include
|
|
15
|
-
* @default -1
|
|
16
|
-
*/
|
|
17
|
-
maxItems?: number;
|
|
18
|
-
/**
|
|
19
|
-
* The maximum length of the joined/final string
|
|
20
|
-
* @default -1
|
|
21
|
-
*/
|
|
22
|
-
maxLength?: number;
|
|
23
|
-
/**
|
|
24
|
-
* The string that is returned if the input array is empty
|
|
25
|
-
* @default 'None'
|
|
26
|
-
*/
|
|
27
|
-
emptyOutput?: string;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
type arrays_JoinOptions = JoinOptions;
|
|
31
|
-
declare const arrays_chunk: typeof chunk;
|
|
32
|
-
declare const arrays_isBooleanArray: typeof isBooleanArray;
|
|
33
|
-
declare const arrays_isNumberArray: typeof isNumberArray;
|
|
34
|
-
declare const arrays_isObjectArray: typeof isObjectArray;
|
|
35
|
-
declare const arrays_isStringArray: typeof isStringArray;
|
|
36
|
-
declare const arrays_join: typeof join;
|
|
37
|
-
declare namespace arrays {
|
|
38
|
-
export { arrays_chunk as chunk, arrays_isBooleanArray as isBooleanArray, arrays_isNumberArray as isNumberArray, arrays_isObjectArray as isObjectArray, arrays_isStringArray as isStringArray, arrays_join as join };
|
|
39
|
-
export type { arrays_JoinOptions as JoinOptions };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { arrays as a, isNumberArray as b, chunk as c, isBooleanArray as d, isObjectArray as e, isStringArray as i, join as j };
|
|
43
|
-
export type { JoinOptions as J };
|