tiny-essentials 1.28.1 → 1.28.3
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/changelog/1/28/2.md +43 -0
- package/changelog/1/28/3.md +9 -0
- package/dist/_/numbers.d.mts +91 -16
- package/dist/v1/TinyBasicsEs.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinyRadioFm.min.js +1 -1
- package/dist/v1/basics/array.d.mts +14 -14
- package/dist/v1/basics/clock.cjs +15 -15
- package/dist/v1/basics/clock.d.mts +21 -21
- package/dist/v1/basics/clock.mjs +15 -15
- package/dist/v1/basics/collision.d.mts +245 -104
- package/dist/v1/basics/deprecated/html.d.mts +33 -33
- package/dist/v1/basics/extendObjType/Buffer.d.mts +1 -1
- package/dist/v1/basics/fullScreen.d.mts +47 -7
- package/dist/v1/basics/html.d.mts +52 -61
- package/dist/v1/basics/index.cjs +2 -0
- package/dist/v1/basics/index.d.mts +11 -67
- package/dist/v1/basics/index.mjs +2 -2
- package/dist/v1/basics/mediaContent.cjs +65 -23
- package/dist/v1/basics/mediaContent.d.mts +144 -73
- package/dist/v1/basics/mediaContent.mjs +65 -23
- package/dist/v1/basics/objChecker.d.mts +2 -2
- package/dist/v1/basics/objFilter.cjs +50 -16
- package/dist/v1/basics/objFilter.d.mts +34 -13
- package/dist/v1/basics/objFilter.mjs +48 -16
- package/dist/v1/basics/simpleMath.d.mts +21 -21
- package/dist/v1/basics/text.d.mts +34 -46
- package/dist/v1/build/ColorSafeStringify.d.mts +1 -1
- package/dist/v1/build/TinyAdvancedRaffle.d.mts +1 -1
- package/dist/v1/build/TinyAfterScrollWatcher.d.mts +1 -1
- package/dist/v1/build/TinyAnalogClock.d.mts +1 -1
- package/dist/v1/build/TinyArrayComparator.d.mts +1 -1
- package/dist/v1/build/TinyArrayPaginator.d.mts +1 -1
- package/dist/v1/build/TinyClassManager.d.mts +1 -1
- package/dist/v1/build/TinyClipboard.d.mts +1 -1
- package/dist/v1/build/TinyColorConverter.d.mts +1 -1
- package/dist/v1/build/TinyColorValidator.d.mts +1 -1
- package/dist/v1/build/TinyCookieConsent.d.mts +1 -1
- package/dist/v1/build/TinyDayNightCycle.d.mts +1 -1
- package/dist/v1/build/TinyDomReadyManager.d.mts +1 -1
- package/dist/v1/build/TinyDragDropDetector.d.mts +1 -1
- package/dist/v1/build/TinyDragger.d.mts +1 -1
- package/dist/v1/build/TinyElementObserver.d.mts +1 -1
- package/dist/v1/build/TinyGamepad.d.mts +1 -1
- package/dist/v1/build/TinyHtml.d.mts +1 -1
- package/dist/v1/build/TinyI18.d.mts +1 -1
- package/dist/v1/build/TinyIframeEvents.d.mts +1 -1
- package/dist/v1/build/TinyInventory.d.mts +1 -1
- package/dist/v1/build/TinyInventoryTrader.d.mts +1 -1
- package/dist/v1/build/TinyLevelUp.d.mts +1 -1
- package/dist/v1/build/TinyLoadingScreen.d.mts +1 -1
- package/dist/v1/build/TinyLocalStorage.d.mts +1 -1
- package/dist/v1/build/TinyMediaPlayer.d.mts +1 -1
- package/dist/v1/build/TinyNeedBar.d.mts +1 -1
- package/dist/v1/build/TinyNewWinEvents.d.mts +1 -1
- package/dist/v1/build/TinyNotifications.d.mts +1 -1
- package/dist/v1/build/TinyNotifyCenter.d.mts +1 -1
- package/dist/v1/build/TinyPromiseQueue.d.mts +1 -1
- package/dist/v1/build/TinyRadioFm.d.mts +1 -1
- package/dist/v1/build/TinyRateLimiter.d.mts +1 -1
- package/dist/v1/build/TinySimpleDice.d.mts +1 -1
- package/dist/v1/build/TinySmartScroller.d.mts +1 -1
- package/dist/v1/build/TinyTextDiffer.d.mts +1 -1
- package/dist/v1/build/TinyTextRangeEditor.d.mts +1 -1
- package/dist/v1/build/TinyTextarea.d.mts +1 -1
- package/dist/v1/build/TinyTimeout.d.mts +1 -1
- package/dist/v1/build/TinyToastNotify.d.mts +1 -1
- package/dist/v1/build/TinyUploadClicker.d.mts +1 -1
- package/dist/v1/build/UltraRandomMsgGen.d.mts +1 -1
- package/dist/v1/fileManager/asyncFuncs.d.mts +13 -13
- package/dist/v1/fileManager/index.d.mts +3 -29
- package/dist/v1/fileManager/normalFuncs.d.mts +22 -22
- package/dist/v1/index.cjs +2 -0
- package/dist/v1/index.d.mts +53 -139
- package/dist/v1/index.mjs +2 -2
- package/dist/v1/libs/ColorSafeStringify.d.mts +3 -12
- package/dist/v1/libs/TinyAdvancedRaffle.d.mts +60 -103
- package/dist/v1/libs/TinyAfterScrollWatcher.d.mts +11 -18
- package/dist/v1/libs/TinyAnalogClock.d.mts +8 -11
- package/dist/v1/libs/TinyArrayComparator.d.mts +14 -20
- package/dist/v1/libs/TinyArrayPaginator.d.mts +22 -26
- package/dist/v1/libs/TinyClassManager/TinyPluginInliner.d.mts +8 -8
- package/dist/v1/libs/TinyClassManager.cjs +5 -7
- package/dist/v1/libs/TinyClassManager.d.mts +16 -16
- package/dist/v1/libs/TinyClassManager.mjs +5 -6
- package/dist/v1/libs/TinyClipboard.d.mts +8 -3
- package/dist/v1/libs/TinyColorConverter.d.mts +8 -31
- package/dist/v1/libs/TinyColorValidator.d.mts +145 -184
- package/dist/v1/libs/TinyCookieConsent.d.mts +17 -17
- package/dist/v1/libs/TinyDayNightCycle.d.mts +85 -110
- package/dist/v1/libs/TinyDomReadyManager.d.mts +8 -16
- package/dist/v1/libs/TinyDragDropDetector.d.mts +30 -30
- package/dist/v1/libs/TinyDragger.d.mts +82 -81
- package/dist/v1/libs/TinyElementObserver.d.mts +25 -28
- package/dist/v1/libs/TinyGamepad.cjs +0 -1
- package/dist/v1/libs/TinyGamepad.d.mts +50 -122
- package/dist/v1/libs/TinyGamepad.mjs +0 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.cjs +2 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.d.mts +19 -25
- package/dist/v1/libs/TinyHtml/TinyHtmlAnchor.mjs +3 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.cjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.d.mts +55 -55
- package/dist/v1/libs/TinyHtml/TinyHtmlButton.mjs +2 -1
- package/dist/v1/libs/TinyHtml/TinyHtmlCanvas.d.mts +6 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.cjs +8 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.d.mts +19 -21
- package/dist/v1/libs/TinyHtml/TinyHtmlDatalist.mjs +7 -4
- package/dist/v1/libs/TinyHtml/TinyHtmlEmbed.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlForm.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/TinyHtmlIcon.d.mts +5 -6
- package/dist/v1/libs/TinyHtml/TinyHtmlIframe.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.cjs +0 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.d.mts +22 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlImage.mjs +1 -27
- package/dist/v1/libs/TinyHtml/TinyHtmlInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/TinyHtmlLink.d.mts +23 -23
- package/dist/v1/libs/TinyHtml/TinyHtmlMedia.d.mts +26 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.cjs +4 -30
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.d.mts +20 -26
- package/dist/v1/libs/TinyHtml/TinyHtmlScript.mjs +5 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlSelect.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/TinyHtmlStyle.d.mts +8 -8
- package/dist/v1/libs/TinyHtml/TinyHtmlTemplate.d.mts +26 -28
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.cjs +14 -15
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.d.mts +32 -32
- package/dist/v1/libs/TinyHtml/TinyHtmlTextarea.mjs +15 -15
- package/dist/v1/libs/TinyHtml/index.d.mts +102 -45
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.cjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/TinyHtmlColorInput.mjs +11 -9
- package/dist/v1/libs/TinyHtml/input/TinyHtmlFileInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.cjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.d.mts +17 -13
- package/dist/v1/libs/TinyHtml/input/TinyHtmlHiddenInput.mjs +4 -4
- package/dist/v1/libs/TinyHtml/input/TinyHtmlImageInput.d.mts +21 -21
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlButtonInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlResetInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.d.mts +19 -19
- package/dist/v1/libs/TinyHtml/input/button/TinyHtmlSubmitInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.cjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.d.mts +11 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlCheckboxInput.mjs +5 -4
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.cjs +4 -3
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.d.mts +15 -11
- package/dist/v1/libs/TinyHtml/input/check/TinyHtmlRadioInput.mjs +4 -3
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.cjs +49 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.d.mts +34 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateInput.mjs +45 -20
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlDateTimeInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlMonthInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.cjs +48 -25
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.d.mts +27 -21
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlTimeInput.mjs +40 -27
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.cjs +1 -1
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/date/TinyHtmlWeekInput.mjs +1 -1
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlNumberInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/number/TinyHtmlRangeInput.d.mts +14 -14
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlEmailInput.d.mts +25 -21
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlPasswordInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlSearchInput.d.mts +33 -29
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTelInput.d.mts +22 -22
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlTextInput.d.mts +18 -18
- package/dist/v1/libs/TinyHtml/input/text/TinyHtmlUrlInput.d.mts +31 -27
- package/dist/v1/libs/TinyHtml/media/TinyHtmlAudio.d.mts +35 -11
- package/dist/v1/libs/TinyHtml/media/TinyHtmlObject.d.mts +10 -10
- package/dist/v1/libs/TinyHtml/media/TinyHtmlSource.d.mts +12 -12
- package/dist/v1/libs/TinyHtml/media/TinyHtmlVideo.d.mts +35 -27
- package/dist/v1/libs/TinyHtml.cjs +3 -4
- package/dist/v1/libs/TinyHtml.d.mts +1503 -1731
- package/dist/v1/libs/TinyHtml.mjs +3 -4
- package/dist/v1/libs/TinyI18.d.mts +23 -61
- package/dist/v1/libs/TinyIframeEvents.cjs +1 -1
- package/dist/v1/libs/TinyIframeEvents.d.mts +29 -38
- package/dist/v1/libs/TinyIframeEvents.mjs +1 -1
- package/dist/v1/libs/TinyInventory.d.mts +78 -141
- package/dist/v1/libs/TinyInventoryTrader.d.mts +19 -22
- package/dist/v1/libs/TinyLevelUp.d.mts +10 -13
- package/dist/v1/libs/TinyLoadingScreen.d.mts +21 -31
- package/dist/v1/libs/TinyLocalStorage.d.mts +11 -36
- package/dist/v1/libs/TinyMamdaniInferenceSystem.d.mts +37 -23
- package/dist/v1/libs/TinyMediaPlayer.cjs +5 -3
- package/dist/v1/libs/TinyMediaPlayer.d.mts +102 -109
- package/dist/v1/libs/TinyMediaPlayer.mjs +5 -3
- package/dist/v1/libs/TinyNeedBar.d.mts +25 -37
- package/dist/v1/libs/TinyNewWinEvents.d.mts +29 -32
- package/dist/v1/libs/TinyNotifications.d.mts +6 -6
- package/dist/v1/libs/TinyNotifyCenter.d.mts +15 -21
- package/dist/v1/libs/TinyPromiseQueue.d.mts +11 -11
- package/dist/v1/libs/TinyRadioFm.cjs +32 -12
- package/dist/v1/libs/TinyRadioFm.d.mts +44 -80
- package/dist/v1/libs/TinyRadioFm.mjs +29 -12
- package/dist/v1/libs/TinyRateLimiter.d.mts +26 -39
- package/dist/v1/libs/TinySimpleDice.d.mts +17 -36
- package/dist/v1/libs/TinySmartScroller.d.mts +50 -60
- package/dist/v1/libs/TinyTextDiffer.d.mts +11 -14
- package/dist/v1/libs/TinyTextRangeEditor.d.mts +8 -8
- package/dist/v1/libs/TinyTextarea.d.mts +31 -31
- package/dist/v1/libs/TinyTimeout.d.mts +14 -14
- package/dist/v1/libs/TinyToastNotify.cjs +1 -1
- package/dist/v1/libs/TinyToastNotify.d.mts +15 -23
- package/dist/v1/libs/TinyToastNotify.mjs +1 -1
- package/dist/v1/libs/TinyUploadClicker.d.mts +38 -14
- package/dist/v1/libs/UltraRandomMsgGen.d.mts +44 -84
- package/dist/v1/libs/utils.d.mts +5 -1
- package/docs/v1/basics/deprecated/objFilter.md +14 -0
- package/docs/v1/basics/objFilter.md +31 -17
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {string} filePath
|
|
5
5
|
* @returns {Promise<any>}
|
|
6
6
|
*/
|
|
7
|
-
export function readJsonFileAsync(filePath: string): Promise<any>;
|
|
7
|
+
export declare function readJsonFileAsync(filePath: string): Promise<any>;
|
|
8
8
|
/**
|
|
9
9
|
* Saves an object as JSON to a file.
|
|
10
10
|
* Automatically creates the directory if it does not exist.
|
|
@@ -13,18 +13,18 @@ export function readJsonFileAsync(filePath: string): Promise<any>;
|
|
|
13
13
|
* @param {number} [spaces=2]
|
|
14
14
|
* @returns {Promise<void>}
|
|
15
15
|
*/
|
|
16
|
-
export function writeJsonFileAsync(filePath: string, data: any, spaces?: number): Promise<void>;
|
|
16
|
+
export declare function writeJsonFileAsync(filePath: string, data: any, spaces?: number): Promise<void>;
|
|
17
17
|
/**
|
|
18
18
|
* Clears all contents inside a directory but keeps the directory.
|
|
19
19
|
* @param {string} dirPath
|
|
20
20
|
*/
|
|
21
|
-
export function clearDirectoryAsync(dirPath: string): Promise<void>;
|
|
21
|
+
export declare function clearDirectoryAsync(dirPath: string): Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Checks whether a directory is empty.
|
|
24
24
|
* @param {string} dirPath
|
|
25
25
|
* @returns {Promise<boolean>}
|
|
26
26
|
*/
|
|
27
|
-
export function isDirEmptyAsync(dirPath: string): Promise<boolean>;
|
|
27
|
+
export declare function isDirEmptyAsync(dirPath: string): Promise<boolean>;
|
|
28
28
|
/**
|
|
29
29
|
* Copies a file to a destination.
|
|
30
30
|
* @param {string} src
|
|
@@ -32,13 +32,13 @@ export function isDirEmptyAsync(dirPath: string): Promise<boolean>;
|
|
|
32
32
|
* @param {number} [mode]
|
|
33
33
|
* @returns {Promise<void>}
|
|
34
34
|
*/
|
|
35
|
-
export function ensureCopyFileAsync(src: string, dest: string, mode?: number): Promise<void>;
|
|
35
|
+
export declare function ensureCopyFileAsync(src: string, dest: string, mode?: number): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Deletes a file (If the file exists).
|
|
38
38
|
* @param {string} filePath
|
|
39
39
|
* @returns {Promise<boolean>}
|
|
40
40
|
*/
|
|
41
|
-
export function tryDeleteFileAsync(filePath: string): Promise<boolean>;
|
|
41
|
+
export declare function tryDeleteFileAsync(filePath: string): Promise<boolean>;
|
|
42
42
|
/**
|
|
43
43
|
* Writes text to a file (Ensures that the directory exists, creating it recursively if needed).
|
|
44
44
|
* @param {string} filePath
|
|
@@ -46,14 +46,14 @@ export function tryDeleteFileAsync(filePath: string): Promise<boolean>;
|
|
|
46
46
|
* @param {import('fs').WriteFileOptions} [ops='utf-8']
|
|
47
47
|
* @returns {Promise<void>}
|
|
48
48
|
*/
|
|
49
|
-
export function writeTextFileAsync(filePath: string, content: string, ops?: import(
|
|
49
|
+
export declare function writeTextFileAsync(filePath: string, content: string, ops?: import('fs').WriteFileOptions): Promise<void>;
|
|
50
50
|
/**
|
|
51
51
|
* Lists all files and dirs in a directory (optionally recursive).
|
|
52
52
|
* @param {string} dirPath
|
|
53
53
|
* @param {boolean} [recursive=false]
|
|
54
54
|
* @returns {Promise<{ files: string[]; dirs: string[] }>}
|
|
55
55
|
*/
|
|
56
|
-
export function listFilesAsync(dirPath: string, recursive?: boolean): Promise<{
|
|
56
|
+
export declare function listFilesAsync(dirPath: string, recursive?: boolean): Promise<{
|
|
57
57
|
files: string[];
|
|
58
58
|
dirs: string[];
|
|
59
59
|
}>;
|
|
@@ -63,31 +63,31 @@ export function listFilesAsync(dirPath: string, recursive?: boolean): Promise<{
|
|
|
63
63
|
* @param {boolean} [recursive=false]
|
|
64
64
|
* @returns {Promise<string[]>}
|
|
65
65
|
*/
|
|
66
|
-
export function listDirsAsync(dirPath: string, recursive?: boolean): Promise<string[]>;
|
|
66
|
+
export declare function listDirsAsync(dirPath: string, recursive?: boolean): Promise<string[]>;
|
|
67
67
|
/**
|
|
68
68
|
* Returns the size of a file in bytes.
|
|
69
69
|
* @param {string} filePath
|
|
70
70
|
* @returns {Promise<number>}
|
|
71
71
|
*/
|
|
72
|
-
export function fileSizeAsync(filePath: string): Promise<number>;
|
|
72
|
+
export declare function fileSizeAsync(filePath: string): Promise<number>;
|
|
73
73
|
/**
|
|
74
74
|
* Returns the total size of a directory in bytes.
|
|
75
75
|
* @param {string} dirPath
|
|
76
76
|
* @returns {Promise<number>}
|
|
77
77
|
*/
|
|
78
|
-
export function dirSizeAsync(dirPath: string): Promise<number>;
|
|
78
|
+
export declare function dirSizeAsync(dirPath: string): Promise<number>;
|
|
79
79
|
/**
|
|
80
80
|
* Restores the most recent backup of a file.
|
|
81
81
|
* @param {string} filePath
|
|
82
82
|
* @param {string} [ext='bak']
|
|
83
83
|
* @returns {Promise<void>}
|
|
84
84
|
*/
|
|
85
|
-
export function restoreLatestBackupAsync(filePath: string, ext?: string): Promise<void>;
|
|
85
|
+
export declare function restoreLatestBackupAsync(filePath: string, ext?: string): Promise<void>;
|
|
86
86
|
/**
|
|
87
87
|
* Creates a backup copy of a file with .bak timestamp suffix.
|
|
88
88
|
* @param {string} filePath
|
|
89
89
|
* @param {string} [ext='bak']
|
|
90
90
|
* @returns {Promise<void>}
|
|
91
91
|
*/
|
|
92
|
-
export function backupFileAsync(filePath: string, ext?: string): Promise<void>;
|
|
92
|
+
export declare function backupFileAsync(filePath: string, ext?: string): Promise<void>;
|
|
93
93
|
//# sourceMappingURL=asyncFuncs.d.mts.map
|
|
@@ -1,30 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fileSizeAsync } from './asyncFuncs.mjs';
|
|
3
|
-
|
|
4
|
-
import { listFilesAsync } from './asyncFuncs.mjs';
|
|
5
|
-
import { listDirsAsync } from './asyncFuncs.mjs';
|
|
6
|
-
import { getLatestBackupPath } from './normalFuncs.mjs';
|
|
7
|
-
import { readJsonFile } from './normalFuncs.mjs';
|
|
8
|
-
import { writeJsonFile } from './normalFuncs.mjs';
|
|
9
|
-
import { ensureDirectory } from './normalFuncs.mjs';
|
|
10
|
-
import { clearDirectory } from './normalFuncs.mjs';
|
|
11
|
-
import { clearDirectoryAsync } from './asyncFuncs.mjs';
|
|
12
|
-
import { fileExists } from './normalFuncs.mjs';
|
|
13
|
-
import { dirExists } from './normalFuncs.mjs';
|
|
14
|
-
import { isDirEmpty } from './normalFuncs.mjs';
|
|
15
|
-
import { ensureCopyFile } from './normalFuncs.mjs';
|
|
16
|
-
import { tryDeleteFile } from './normalFuncs.mjs';
|
|
17
|
-
import { writeTextFile } from './normalFuncs.mjs';
|
|
18
|
-
import { listFiles } from './normalFuncs.mjs';
|
|
19
|
-
import { listDirs } from './normalFuncs.mjs';
|
|
20
|
-
import { fileSize } from './normalFuncs.mjs';
|
|
21
|
-
import { dirSize } from './normalFuncs.mjs';
|
|
22
|
-
import { backupFile } from './normalFuncs.mjs';
|
|
23
|
-
import { restoreLatestBackup } from './normalFuncs.mjs';
|
|
24
|
-
import { renameFileBatch } from './normalFuncs.mjs';
|
|
25
|
-
import { renameFileRegex } from './normalFuncs.mjs';
|
|
26
|
-
import { renameFileAddPrefixSuffix } from './normalFuncs.mjs';
|
|
27
|
-
import { renameFileNormalizeCase } from './normalFuncs.mjs';
|
|
28
|
-
import { renameFilePadNumbers } from './normalFuncs.mjs';
|
|
29
|
-
export { isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getLatestBackupPath, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, clearDirectoryAsync, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers };
|
|
1
|
+
import { readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, getLatestBackupPath } from './normalFuncs.mjs';
|
|
2
|
+
import { listFilesAsync, listDirsAsync, clearDirectoryAsync, fileSizeAsync, dirSizeAsync, isDirEmptyAsync } from './asyncFuncs.mjs';
|
|
3
|
+
export { isDirEmptyAsync, fileSizeAsync, dirSizeAsync, listFilesAsync, listDirsAsync, getLatestBackupPath, readJsonFile, writeJsonFile, ensureDirectory, clearDirectory, clearDirectoryAsync, fileExists, dirExists, isDirEmpty, ensureCopyFile, tryDeleteFile, writeTextFile, listFiles, listDirs, fileSize, dirSize, backupFile, restoreLatestBackup, renameFileBatch, renameFileRegex, renameFileAddPrefixSuffix, renameFileNormalizeCase, renameFilePadNumbers, };
|
|
30
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param {string} filePath
|
|
5
5
|
* @returns {any}
|
|
6
6
|
*/
|
|
7
|
-
export function readJsonFile(filePath: string): any;
|
|
7
|
+
export declare function readJsonFile(filePath: string): any;
|
|
8
8
|
/**
|
|
9
9
|
* Saves an object as JSON to a file.
|
|
10
10
|
* Automatically creates the directory if it does not exist.
|
|
@@ -12,62 +12,62 @@ export function readJsonFile(filePath: string): any;
|
|
|
12
12
|
* @param {any} data
|
|
13
13
|
* @param {number} [spaces=2]
|
|
14
14
|
*/
|
|
15
|
-
export function writeJsonFile(filePath: string, data: any, spaces?: number): void;
|
|
15
|
+
export declare function writeJsonFile(filePath: string, data: any, spaces?: number): void;
|
|
16
16
|
/**
|
|
17
17
|
* Ensures that the directory exists, creating it recursively if needed.
|
|
18
18
|
* @param {string} dirPath
|
|
19
19
|
*/
|
|
20
|
-
export function ensureDirectory(dirPath: string): void;
|
|
20
|
+
export declare function ensureDirectory(dirPath: string): void;
|
|
21
21
|
/**
|
|
22
22
|
* Clears all contents inside a directory but keeps the directory.
|
|
23
23
|
* @param {string} dirPath
|
|
24
24
|
*/
|
|
25
|
-
export function clearDirectory(dirPath: string): void;
|
|
25
|
+
export declare function clearDirectory(dirPath: string): void;
|
|
26
26
|
/**
|
|
27
27
|
* Checks whether a file exists.
|
|
28
28
|
* @param {string} filePath
|
|
29
29
|
* @returns {boolean}
|
|
30
30
|
*/
|
|
31
|
-
export function fileExists(filePath: string): boolean;
|
|
31
|
+
export declare function fileExists(filePath: string): boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Checks whether a directory exists.
|
|
34
34
|
* @param {string} dirPath
|
|
35
35
|
* @returns {boolean}
|
|
36
36
|
*/
|
|
37
|
-
export function dirExists(dirPath: string): boolean;
|
|
37
|
+
export declare function dirExists(dirPath: string): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Checks whether a directory is empty.
|
|
40
40
|
* @param {string} dirPath
|
|
41
41
|
* @returns {boolean}
|
|
42
42
|
*/
|
|
43
|
-
export function isDirEmpty(dirPath: string): boolean;
|
|
43
|
+
export declare function isDirEmpty(dirPath: string): boolean;
|
|
44
44
|
/**
|
|
45
45
|
* Copies a file to a destination.
|
|
46
46
|
* @param {string} src
|
|
47
47
|
* @param {string} dest
|
|
48
48
|
* @param {number} [mode]
|
|
49
49
|
*/
|
|
50
|
-
export function ensureCopyFile(src: string, dest: string, mode?: number): void;
|
|
50
|
+
export declare function ensureCopyFile(src: string, dest: string, mode?: number): void;
|
|
51
51
|
/**
|
|
52
52
|
* Deletes a file (If the file exists).
|
|
53
53
|
* @param {string} filePath
|
|
54
54
|
* @returns {boolean}
|
|
55
55
|
*/
|
|
56
|
-
export function tryDeleteFile(filePath: string): boolean;
|
|
56
|
+
export declare function tryDeleteFile(filePath: string): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Writes text to a file (Ensures that the directory exists, creating it recursively if needed).
|
|
59
59
|
* @param {string} filePath
|
|
60
60
|
* @param {string} content
|
|
61
61
|
* @param {import('fs').WriteFileOptions} [ops='utf-8']
|
|
62
62
|
*/
|
|
63
|
-
export function writeTextFile(filePath: string, content: string, ops?: import(
|
|
63
|
+
export declare function writeTextFile(filePath: string, content: string, ops?: import('fs').WriteFileOptions): void;
|
|
64
64
|
/**
|
|
65
65
|
* Lists all files and dirs in a directory (optionally recursive).
|
|
66
66
|
* @param {string} dirPath
|
|
67
67
|
* @param {boolean} [recursive=false]
|
|
68
68
|
* @returns {{ files: string[]; dirs: string[] }}
|
|
69
69
|
*/
|
|
70
|
-
export function listFiles(dirPath: string, recursive?: boolean): {
|
|
70
|
+
export declare function listFiles(dirPath: string, recursive?: boolean): {
|
|
71
71
|
files: string[];
|
|
72
72
|
dirs: string[];
|
|
73
73
|
};
|
|
@@ -77,38 +77,38 @@ export function listFiles(dirPath: string, recursive?: boolean): {
|
|
|
77
77
|
* @param {boolean} [recursive=false]
|
|
78
78
|
* @returns {string[]}
|
|
79
79
|
*/
|
|
80
|
-
export function listDirs(dirPath: string, recursive?: boolean): string[];
|
|
80
|
+
export declare function listDirs(dirPath: string, recursive?: boolean): string[];
|
|
81
81
|
/**
|
|
82
82
|
* Returns the size of a file in bytes.
|
|
83
83
|
* @param {string} filePath
|
|
84
84
|
* @returns {number}
|
|
85
85
|
*/
|
|
86
|
-
export function fileSize(filePath: string): number;
|
|
86
|
+
export declare function fileSize(filePath: string): number;
|
|
87
87
|
/**
|
|
88
88
|
* Returns the total size of a directory in bytes.
|
|
89
89
|
* @param {string} dirPath
|
|
90
90
|
* @returns {number}
|
|
91
91
|
*/
|
|
92
|
-
export function dirSize(dirPath: string): number;
|
|
92
|
+
export declare function dirSize(dirPath: string): number;
|
|
93
93
|
/**
|
|
94
94
|
* Creates a backup copy of a file with .bak timestamp suffix.
|
|
95
95
|
* @param {string} filePath
|
|
96
96
|
* @param {string} [ext='bak']
|
|
97
97
|
*/
|
|
98
|
-
export function backupFile(filePath: string, ext?: string): void;
|
|
98
|
+
export declare function backupFile(filePath: string, ext?: string): void;
|
|
99
99
|
/**
|
|
100
100
|
* Returns the most recent backup file path for a given file.
|
|
101
101
|
* @param {string} filePath
|
|
102
102
|
* @param {string} [ext='bak']
|
|
103
103
|
* @returns {string} Full path to the most recent backup
|
|
104
104
|
*/
|
|
105
|
-
export function getLatestBackupPath(filePath: string, ext?: string): string;
|
|
105
|
+
export declare function getLatestBackupPath(filePath: string, ext?: string): string;
|
|
106
106
|
/**
|
|
107
107
|
* Restores the most recent backup of a file.
|
|
108
108
|
* @param {string} filePath
|
|
109
109
|
* @param {string} [ext='bak']
|
|
110
110
|
*/
|
|
111
|
-
export function restoreLatestBackup(filePath: string, ext?: string): void;
|
|
111
|
+
export declare function restoreLatestBackup(filePath: string, ext?: string): void;
|
|
112
112
|
/**
|
|
113
113
|
* Renames multiple files in a directory using a rename function.
|
|
114
114
|
* @param {string} dirPath - The target directory.
|
|
@@ -118,7 +118,7 @@ export function restoreLatestBackup(filePath: string, ext?: string): void;
|
|
|
118
118
|
* @throws {TypeError} If any argument has an invalid type.
|
|
119
119
|
* @throws {Error} If the directory does not exist or contains invalid files.
|
|
120
120
|
*/
|
|
121
|
-
export function renameFileBatch(dirPath: string, renameFn: (original: string, index: number) => string, extensions?: string[]): void;
|
|
121
|
+
export declare function renameFileBatch(dirPath: string, renameFn: (original: string, index: number) => string, extensions?: string[]): void;
|
|
122
122
|
/**
|
|
123
123
|
* Renames files using regex replacement.
|
|
124
124
|
* @param {string} dirPath
|
|
@@ -126,14 +126,14 @@ export function renameFileBatch(dirPath: string, renameFn: (original: string, in
|
|
|
126
126
|
* @param {string} replacement - Replacement string.
|
|
127
127
|
* @param {string[]} [extensions]
|
|
128
128
|
*/
|
|
129
|
-
export function renameFileRegex(dirPath: string, pattern: RegExp, replacement: string, extensions?: string[]): void;
|
|
129
|
+
export declare function renameFileRegex(dirPath: string, pattern: RegExp, replacement: string, extensions?: string[]): void;
|
|
130
130
|
/**
|
|
131
131
|
* Adds a prefix or suffix to filenames.
|
|
132
132
|
* @param {string} dirPath
|
|
133
133
|
* @param {{ prefix?: string, suffix?: string }} options
|
|
134
134
|
* @param {string[]} [extensions]
|
|
135
135
|
*/
|
|
136
|
-
export function renameFileAddPrefixSuffix(dirPath: string, { prefix, suffix }: {
|
|
136
|
+
export declare function renameFileAddPrefixSuffix(dirPath: string, { prefix, suffix }: {
|
|
137
137
|
prefix?: string;
|
|
138
138
|
suffix?: string;
|
|
139
139
|
}, extensions?: string[]): void;
|
|
@@ -145,12 +145,12 @@ export function renameFileAddPrefixSuffix(dirPath: string, { prefix, suffix }: {
|
|
|
145
145
|
* @param {boolean} [normalizeExt=false] - Whether to apply case change to file extensions too.
|
|
146
146
|
* @throws {Error} If mode is invalid.
|
|
147
147
|
*/
|
|
148
|
-
export function renameFileNormalizeCase(dirPath: string, mode?:
|
|
148
|
+
export declare function renameFileNormalizeCase(dirPath: string, mode?: 'lower' | 'upper' | 'title', extensions?: string[], normalizeExt?: boolean): void;
|
|
149
149
|
/**
|
|
150
150
|
* Pads numbers in filenames (e.g., "img1.jpg" -> "img001.jpg").
|
|
151
151
|
* @param {string} dirPath
|
|
152
152
|
* @param {number} totalDigits
|
|
153
153
|
* @param {string[]} [extensions]
|
|
154
154
|
*/
|
|
155
|
-
export function renameFilePadNumbers(dirPath: string, totalDigits?: number, extensions?: string[]): void;
|
|
155
|
+
export declare function renameFilePadNumbers(dirPath: string, totalDigits?: number, extensions?: string[]): void;
|
|
156
156
|
//# sourceMappingURL=normalFuncs.d.mts.map
|
package/dist/v1/index.cjs
CHANGED
|
@@ -71,7 +71,9 @@ exports.getTimeDuration = clock.getTimeDuration;
|
|
|
71
71
|
exports.checkObj = objFilter.checkObj;
|
|
72
72
|
exports.cloneObjTypeOrder = objFilter.cloneObjTypeOrder;
|
|
73
73
|
exports.extendObjType = objFilter.extendObjType;
|
|
74
|
+
exports.isObjType = objFilter.isObjType;
|
|
74
75
|
exports.objType = objFilter.objType;
|
|
76
|
+
exports.objTypeName = objFilter.objTypeName;
|
|
75
77
|
exports.reorderObjTypeOrder = objFilter.reorderObjTypeOrder;
|
|
76
78
|
exports.countObj = objChecker.countObj;
|
|
77
79
|
exports.isJsonObject = objChecker.isJsonObject;
|