diginext-utils 2.0.32 → 2.0.33
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/README.md +162 -162
- package/dist/Checker.d.ts +8 -7
- package/dist/Checker.js +48 -28
- package/dist/Checker.mjs +29 -0
- package/dist/EventDispatcher.d.ts +12 -12
- package/dist/EventDispatcher.js +72 -47
- package/dist/EventDispatcher.mjs +54 -0
- package/dist/FileUpload.d.ts +11 -11
- package/dist/FileUpload.js +81 -61
- package/dist/FileUpload.mjs +62 -0
- package/dist/Slug.d.ts +9 -8
- package/dist/Slug.js +350 -330
- package/dist/Slug.mjs +331 -0
- package/dist/Timer-7b0c4e7c.d.ts +11 -0
- package/dist/Timer.d.ts +1 -4
- package/dist/Timer.js +31 -7
- package/dist/Timer.mjs +7 -0
- package/dist/Validation.d.ts +5 -4
- package/dist/Validation.js +54 -37
- package/dist/Validation.mjs +35 -0
- package/dist/array-dc599632.d.ts +158 -0
- package/dist/array.d.ts +1 -113
- package/dist/array.js +246 -266
- package/dist/array.mjs +49 -0
- package/dist/browser-8d042ffe.d.ts +22 -0
- package/dist/camera-1a859d72.d.ts +15 -0
- package/dist/chunk-5NTK5JAI.mjs +57 -0
- package/dist/chunk-5UEMANWE.mjs +91 -0
- package/dist/chunk-5ZOWNKSD.mjs +166 -0
- package/dist/chunk-6GNGTFNC.mjs +118 -0
- package/dist/chunk-7MK72U4O.mjs +19 -0
- package/dist/chunk-7XKT3AQX.mjs +17 -0
- package/dist/chunk-7ZCEZM7K.mjs +41 -0
- package/dist/chunk-AMBWJGSW.mjs +151 -0
- package/dist/chunk-C7S43KGB.mjs +15 -0
- package/dist/chunk-CJM7T7ON.mjs +24 -0
- package/dist/chunk-CKILLYAP.mjs +16 -0
- package/dist/chunk-DX7MUT3M.mjs +51 -0
- package/dist/chunk-EGUJQ5VF.mjs +32 -0
- package/dist/chunk-ETEIHDWU.mjs +25 -0
- package/dist/chunk-FJXSVGL7.mjs +22 -0
- package/dist/chunk-GJCAEOND.mjs +20 -0
- package/dist/chunk-GNJDIUYM.mjs +40 -0
- package/dist/chunk-IA7GINWD.mjs +39 -0
- package/dist/chunk-JEI7BOXY.mjs +21 -0
- package/dist/chunk-K4KENOE6.mjs +20 -0
- package/dist/chunk-KMERW6KS.mjs +34 -0
- package/dist/chunk-KPO3RH5G.mjs +27 -0
- package/dist/chunk-KWG5LYNK.mjs +100 -0
- package/dist/chunk-NUTQDHLQ.mjs +40 -0
- package/dist/chunk-O64XUDAH.mjs +35 -0
- package/dist/chunk-OYRPWQUA.mjs +257 -0
- package/dist/chunk-PNZ4KGXL.mjs +56 -0
- package/dist/chunk-QZYX26HT.mjs +24 -0
- package/dist/chunk-RDGP2CKM.mjs +195 -0
- package/dist/chunk-VFG5VU6S.mjs +12 -0
- package/dist/chunk-X3IMFCZG.mjs +23 -0
- package/dist/chunk-ZHNGZMRD.mjs +17 -0
- package/dist/color.d.ts +23 -22
- package/dist/color.js +96 -79
- package/dist/color.mjs +78 -0
- package/dist/console/enableConsole.d.ts +1 -2
- package/dist/console/enableConsole.js +38 -10
- package/dist/console/enableConsole.mjs +9 -0
- package/dist/console/index.d.ts +2 -11
- package/dist/console/index.js +58 -15
- package/dist/console/index.mjs +14 -0
- package/dist/console/log.d.ts +15 -14
- package/dist/console/log.js +74 -44
- package/dist/console/log.mjs +19 -0
- package/dist/createDir-220e0081.d.ts +13 -0
- package/dist/device/browser.d.ts +1 -5
- package/dist/device/browser.js +60 -32
- package/dist/device/browser.mjs +15 -0
- package/dist/device/camera.d.ts +1 -7
- package/dist/device/camera.js +184 -166
- package/dist/device/camera.mjs +8 -0
- package/dist/device/index.d.ts +1 -5
- package/dist/device/index.js +201 -216
- package/dist/device/index.mjs +15 -0
- package/dist/device/os.d.ts +11 -10
- package/dist/device/os.js +55 -28
- package/dist/device/os.mjs +33 -0
- package/dist/enableConsole-ddc24282.d.ts +11 -0
- package/dist/file/createDir.d.ts +1 -5
- package/dist/file/createDir.js +34 -13
- package/dist/file/createDir.mjs +7 -0
- package/dist/file/fileMove.d.ts +1 -4
- package/dist/file/fileMove.js +49 -29
- package/dist/file/fileMove.mjs +7 -0
- package/dist/file/findFilesByExt.d.ts +1 -13
- package/dist/file/findFilesByExt.js +64 -45
- package/dist/file/findFilesByExt.mjs +11 -0
- package/dist/file/index.d.ts +10 -8
- package/dist/file/index.js +104 -9
- package/dist/file/index.mjs +17 -0
- package/dist/fileMove-3a09e429.d.ts +13 -0
- package/dist/findFilesByExt-753e91d7.d.ts +24 -0
- package/dist/images/index.d.ts +2 -2
- package/dist/images/index.js +131 -8
- package/dist/images/index.mjs +15 -0
- package/dist/images/loadImage.d.ts +3 -0
- package/dist/images/loadImage.js +42 -0
- package/dist/images/loadImage.mjs +21 -0
- package/dist/images/resize.d.ts +3 -2
- package/dist/images/resize.js +60 -34
- package/dist/images/resize.mjs +9 -0
- package/dist/images/upload.d.ts +10 -9
- package/dist/images/upload.js +130 -25
- package/dist/images/upload.mjs +14 -0
- package/dist/index-1f738e52.d.ts +22 -0
- package/dist/index-22309f0c.d.ts +23 -0
- package/dist/index-6ae3c86b.d.ts +63 -0
- package/dist/index-c8fffc86.d.ts +90 -0
- package/dist/index-d652ed2c.d.ts +26 -0
- package/dist/index.d.ts +47 -36
- package/dist/index.js +1352 -62
- package/dist/index.mjs +87 -0
- package/dist/json.d.ts +8 -7
- package/dist/json.js +48 -28
- package/dist/json.mjs +29 -0
- package/dist/math/diffDate.d.ts +6 -5
- package/dist/math/diffDate.js +33 -11
- package/dist/math/diffDate.mjs +9 -0
- package/dist/math/index.d.ts +3 -30
- package/dist/math/index.js +159 -92
- package/dist/math/index.mjs +34 -0
- package/dist/math/positiveNumber.d.ts +3 -2
- package/dist/math/positiveNumber.js +53 -14
- package/dist/math/positiveNumber.mjs +10 -0
- package/dist/name/en.d.ts +5 -4
- package/dist/name/en.js +37 -19
- package/dist/name/en.mjs +9 -0
- package/dist/name/index.d.ts +3 -12
- package/dist/name/index.js +87 -12
- package/dist/name/index.mjs +20 -0
- package/dist/name/vi.d.ts +5 -4
- package/dist/name/vi.js +63 -25
- package/dist/name/vi.mjs +14 -0
- package/{esm/object.d.ts → dist/object-43aaaf92.d.ts} +79 -58
- package/dist/object.d.ts +1 -59
- package/dist/object.js +96 -71
- package/dist/object.mjs +21 -0
- package/dist/permission/index.d.ts +8 -7
- package/dist/permission/index.js +230 -6
- package/dist/permission/index.mjs +15 -0
- package/dist/permission/requestCamera.d.ts +1 -5
- package/dist/permission/requestCamera.js +49 -38
- package/dist/permission/requestCamera.mjs +9 -0
- package/dist/permission/requestDeviceOrientationControl.d.ts +1 -2
- package/dist/permission/requestDeviceOrientationControl.js +203 -36
- package/dist/permission/requestDeviceOrientationControl.mjs +10 -0
- package/dist/requestCamera-32b7dfc7.d.ts +14 -0
- package/dist/requestDeviceOrientationControl-b6458660.d.ts +11 -0
- package/dist/response/index.d.ts +49 -48
- package/dist/response/index.js +92 -47
- package/dist/response/index.mjs +16 -0
- package/dist/string/formatNumber.d.ts +7 -6
- package/dist/string/formatNumber.js +53 -12
- package/dist/string/formatNumber.mjs +10 -0
- package/dist/string/generatePassword.d.ts +10 -9
- package/dist/string/generatePassword.js +52 -21
- package/dist/string/generatePassword.mjs +10 -0
- package/dist/string/generateUUID.d.ts +3 -2
- package/dist/string/generateUUID.js +37 -34
- package/dist/string/generateUUID.mjs +9 -0
- package/dist/string/index.d.ts +6 -65
- package/dist/string/index.js +312 -157
- package/dist/string/index.mjs +31 -0
- package/dist/string/makeDaySlug.d.ts +31 -30
- package/dist/string/makeDaySlug.js +43 -19
- package/dist/string/makeDaySlug.mjs +9 -0
- package/dist/string/random.d.ts +14 -13
- package/dist/string/random.js +53 -22
- package/dist/string/random.mjs +19 -0
- package/dist/string/trimNull.d.ts +3 -2
- package/dist/string/trimNull.js +45 -17
- package/dist/string/trimNull.mjs +9 -0
- package/dist/string/url.d.ts +1 -36
- package/dist/string/url.js +115 -97
- package/dist/string/url.mjs +22 -0
- package/dist/url-60657387.d.ts +57 -0
- package/package.json +66 -66
- package/src/Checker.ts +29 -29
- package/src/EventDispatcher.ts +62 -62
- package/src/FileUpload.ts +66 -66
- package/src/Slug.ts +365 -365
- package/src/Timer.ts +7 -7
- package/src/Validation.ts +36 -36
- package/src/array.ts +285 -285
- package/src/color.ts +87 -87
- package/src/console/enableConsole.ts +8 -8
- package/src/console/index.ts +17 -17
- package/src/console/log.ts +39 -39
- package/src/device/browser.ts +29 -29
- package/src/device/camera.ts +207 -207
- package/src/device/index.ts +230 -230
- package/src/device/os.ts +29 -29
- package/src/file/createDir.ts +14 -14
- package/src/file/fileMove.ts +32 -32
- package/src/file/findFilesByExt.ts +46 -46
- package/src/file/index.ts +7 -7
- package/src/images/index.ts +3 -3
- package/src/images/loadImage.ts +16 -0
- package/src/images/resize.ts +35 -35
- package/src/images/upload.ts +24 -24
- package/src/index.ts +39 -39
- package/src/json.ts +29 -29
- package/src/math/diffDate.ts +10 -10
- package/src/math/index.ts +90 -90
- package/src/math/positiveNumber.ts +12 -12
- package/src/name/en.ts +27 -27
- package/src/name/index.ts +8 -8
- package/src/name/vi.ts +23 -23
- package/src/object.ts +72 -72
- package/src/permission/index.ts +6 -6
- package/src/permission/requestCamera.ts +43 -43
- package/src/permission/requestDeviceOrientationControl.ts +33 -33
- package/src/response/index.ts +45 -45
- package/src/string/formatNumber.ts +12 -12
- package/src/string/generatePassword.ts +18 -18
- package/src/string/generateUUID.ts +37 -37
- package/src/string/index.ts +180 -180
- package/src/string/makeDaySlug.ts +40 -40
- package/src/string/random.ts +24 -24
- package/src/string/trimNull.ts +16 -16
- package/src/string/url.ts +116 -116
- package/dist/Checker.js.map +0 -1
- package/dist/EventDispatcher.js.map +0 -1
- package/dist/FileUpload.js.map +0 -1
- package/dist/Slug.js.map +0 -1
- package/dist/Timer.js.map +0 -1
- package/dist/Validation.js.map +0 -1
- package/dist/array.js.map +0 -1
- package/dist/color.js.map +0 -1
- package/dist/console/enableConsole.js.map +0 -1
- package/dist/console/index.js.map +0 -1
- package/dist/console/log.js.map +0 -1
- package/dist/device/browser.js.map +0 -1
- package/dist/device/camera.js.map +0 -1
- package/dist/device/index.js.map +0 -1
- package/dist/device/os.js.map +0 -1
- package/dist/file/createDir.js.map +0 -1
- package/dist/file/fileMove.js.map +0 -1
- package/dist/file/findFilesByExt.js.map +0 -1
- package/dist/file/index.js.map +0 -1
- package/dist/images/index.js.map +0 -1
- package/dist/images/resize.js.map +0 -1
- package/dist/images/upload.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/json.js.map +0 -1
- package/dist/math/diffDate.js.map +0 -1
- package/dist/math/index.js.map +0 -1
- package/dist/math/positiveNumber.js.map +0 -1
- package/dist/name/en.js.map +0 -1
- package/dist/name/index.js.map +0 -1
- package/dist/name/vi.js.map +0 -1
- package/dist/object.js.map +0 -1
- package/dist/permission/index.js.map +0 -1
- package/dist/permission/requestCamera.js.map +0 -1
- package/dist/permission/requestDeviceOrientationControl.js.map +0 -1
- package/dist/response/index.js.map +0 -1
- package/dist/string/formatNumber.js.map +0 -1
- package/dist/string/generatePassword.js.map +0 -1
- package/dist/string/generateUUID.js.map +0 -1
- package/dist/string/index.js.map +0 -1
- package/dist/string/makeDaySlug.js.map +0 -1
- package/dist/string/random.js.map +0 -1
- package/dist/string/trimNull.js.map +0 -1
- package/dist/string/url.js.map +0 -1
- package/esm/Checker.d.ts +0 -8
- package/esm/Checker.js +0 -28
- package/esm/Checker.js.map +0 -1
- package/esm/EventDispatcher.d.ts +0 -13
- package/esm/EventDispatcher.js +0 -49
- package/esm/EventDispatcher.js.map +0 -1
- package/esm/FileUpload.d.ts +0 -12
- package/esm/FileUpload.js +0 -62
- package/esm/FileUpload.js.map +0 -1
- package/esm/Slug.d.ts +0 -9
- package/esm/Slug.js +0 -330
- package/esm/Slug.js.map +0 -1
- package/esm/Timer.d.ts +0 -4
- package/esm/Timer.js +0 -7
- package/esm/Timer.js.map +0 -1
- package/esm/Validation.d.ts +0 -5
- package/esm/Validation.js +0 -37
- package/esm/Validation.js.map +0 -1
- package/esm/array.d.ts +0 -113
- package/esm/array.js +0 -275
- package/esm/array.js.map +0 -1
- package/esm/color.d.ts +0 -23
- package/esm/color.js +0 -80
- package/esm/color.js.map +0 -1
- package/esm/console/enableConsole.d.ts +0 -2
- package/esm/console/enableConsole.js +0 -7
- package/esm/console/enableConsole.js.map +0 -1
- package/esm/console/index.d.ts +0 -11
- package/esm/console/index.js +0 -13
- package/esm/console/index.js.map +0 -1
- package/esm/console/log.d.ts +0 -15
- package/esm/console/log.js +0 -33
- package/esm/console/log.js.map +0 -1
- package/esm/device/browser.d.ts +0 -5
- package/esm/device/browser.js +0 -30
- package/esm/device/browser.js.map +0 -1
- package/esm/device/camera.d.ts +0 -7
- package/esm/device/camera.js +0 -168
- package/esm/device/camera.js.map +0 -1
- package/esm/device/index.d.ts +0 -5
- package/esm/device/index.js +0 -217
- package/esm/device/index.js.map +0 -1
- package/esm/device/os.d.ts +0 -11
- package/esm/device/os.js +0 -28
- package/esm/device/os.js.map +0 -1
- package/esm/file/createDir.d.ts +0 -5
- package/esm/file/createDir.js +0 -13
- package/esm/file/createDir.js.map +0 -1
- package/esm/file/fileMove.d.ts +0 -4
- package/esm/file/fileMove.js +0 -29
- package/esm/file/fileMove.js.map +0 -1
- package/esm/file/findFilesByExt.d.ts +0 -13
- package/esm/file/findFilesByExt.js +0 -46
- package/esm/file/findFilesByExt.js.map +0 -1
- package/esm/file/index.d.ts +0 -9
- package/esm/file/index.js +0 -6
- package/esm/file/index.js.map +0 -1
- package/esm/images/index.d.ts +0 -2
- package/esm/images/index.js +0 -4
- package/esm/images/index.js.map +0 -1
- package/esm/images/resize.d.ts +0 -2
- package/esm/images/resize.js +0 -31
- package/esm/images/resize.js.map +0 -1
- package/esm/images/upload.d.ts +0 -10
- package/esm/images/upload.js +0 -20
- package/esm/images/upload.js.map +0 -1
- package/esm/index.d.ts +0 -37
- package/esm/index.js +0 -38
- package/esm/index.js.map +0 -1
- package/esm/json.d.ts +0 -8
- package/esm/json.js +0 -28
- package/esm/json.js.map +0 -1
- package/esm/math/diffDate.d.ts +0 -5
- package/esm/math/diffDate.js +0 -10
- package/esm/math/diffDate.js.map +0 -1
- package/esm/math/index.d.ts +0 -30
- package/esm/math/index.js +0 -78
- package/esm/math/index.js.map +0 -1
- package/esm/math/positiveNumber.d.ts +0 -2
- package/esm/math/positiveNumber.js +0 -13
- package/esm/math/positiveNumber.js.map +0 -1
- package/esm/name/en.d.ts +0 -5
- package/esm/name/en.js +0 -22
- package/esm/name/en.js.map +0 -1
- package/esm/name/index.d.ts +0 -12
- package/esm/name/index.js +0 -6
- package/esm/name/index.js.map +0 -1
- package/esm/name/vi.d.ts +0 -5
- package/esm/name/vi.js +0 -24
- package/esm/name/vi.js.map +0 -1
- package/esm/object.js +0 -70
- package/esm/object.js.map +0 -1
- package/esm/permission/index.d.ts +0 -8
- package/esm/permission/index.js +0 -5
- package/esm/permission/index.js.map +0 -1
- package/esm/permission/requestCamera.d.ts +0 -5
- package/esm/permission/requestCamera.js +0 -39
- package/esm/permission/requestCamera.js.map +0 -1
- package/esm/permission/requestDeviceOrientationControl.d.ts +0 -2
- package/esm/permission/requestDeviceOrientationControl.js +0 -35
- package/esm/permission/requestDeviceOrientationControl.js.map +0 -1
- package/esm/response/index.d.ts +0 -49
- package/esm/response/index.js +0 -46
- package/esm/response/index.js.map +0 -1
- package/esm/string/formatNumber.d.ts +0 -6
- package/esm/string/formatNumber.js +0 -11
- package/esm/string/formatNumber.js.map +0 -1
- package/esm/string/generatePassword.d.ts +0 -9
- package/esm/string/generatePassword.js +0 -20
- package/esm/string/generatePassword.js.map +0 -1
- package/esm/string/generateUUID.d.ts +0 -2
- package/esm/string/generateUUID.js +0 -33
- package/esm/string/generateUUID.js.map +0 -1
- package/esm/string/index.d.ts +0 -65
- package/esm/string/index.js +0 -150
- package/esm/string/index.js.map +0 -1
- package/esm/string/makeDaySlug.d.ts +0 -31
- package/esm/string/makeDaySlug.js +0 -16
- package/esm/string/makeDaySlug.js.map +0 -1
- package/esm/string/random.d.ts +0 -14
- package/esm/string/random.js +0 -20
- package/esm/string/random.js.map +0 -1
- package/esm/string/trimNull.d.ts +0 -2
- package/esm/string/trimNull.js +0 -14
- package/esm/string/trimNull.js.map +0 -1
- package/esm/string/url.d.ts +0 -36
- package/esm/string/url.js +0 -98
- package/esm/string/url.js.map +0 -1
|
@@ -1,24 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/string/generatePassword.ts
|
|
21
|
+
var generatePassword_exports = {};
|
|
22
|
+
__export(generatePassword_exports, {
|
|
23
|
+
default: () => generatePassword_default,
|
|
24
|
+
generatePassword: () => generatePassword
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(generatePassword_exports);
|
|
27
|
+
|
|
28
|
+
// src/string/random.ts
|
|
29
|
+
var textLowCase = "abcdefghijklmnopqrstuvwxyz";
|
|
30
|
+
var numeric = "0123456789";
|
|
31
|
+
var punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
|
|
32
|
+
var randomStringByLength = (length, str = textLowCase) => {
|
|
33
|
+
let result = "";
|
|
34
|
+
for (let i = 0; i < length; i++) {
|
|
35
|
+
result += str.charAt(Math.floor(Math.random() * str.length));
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// src/string/generatePassword.ts
|
|
12
41
|
function generatePassword(length = 6, hard = true) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
42
|
+
if (!Number.isFinite(length))
|
|
43
|
+
length = 6;
|
|
44
|
+
if (length <= 0)
|
|
45
|
+
length = 6;
|
|
46
|
+
let pass = randomStringByLength(length, textLowCase + textLowCase.toUpperCase() + numeric);
|
|
47
|
+
if (hard)
|
|
48
|
+
pass = pass.replace(pass[Math.floor(pass.length / 2)], randomStringByLength(1, punctuation));
|
|
49
|
+
return pass;
|
|
21
50
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
var generatePassword_default = generatePassword;
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
generatePassword
|
|
55
|
+
});
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function generateUUID(): string;
|
|
2
|
+
|
|
3
|
+
export { generateUUID as default, generateUUID };
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/string/generateUUID.ts
|
|
21
|
+
var generateUUID_exports = {};
|
|
22
|
+
__export(generateUUID_exports, {
|
|
23
|
+
default: () => generateUUID_default,
|
|
24
|
+
generateUUID: () => generateUUID
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(generateUUID_exports);
|
|
27
|
+
var _lut = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
6
28
|
function generateUUID() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_lut[(d0 >> 8) & 0xff] +
|
|
14
|
-
_lut[(d0 >> 16) & 0xff] +
|
|
15
|
-
_lut[(d0 >> 24) & 0xff] +
|
|
16
|
-
"-" +
|
|
17
|
-
_lut[d1 & 0xff] +
|
|
18
|
-
_lut[(d1 >> 8) & 0xff] +
|
|
19
|
-
"-" +
|
|
20
|
-
_lut[((d1 >> 16) & 0x0f) | 0x40] +
|
|
21
|
-
_lut[(d1 >> 24) & 0xff] +
|
|
22
|
-
"-" +
|
|
23
|
-
_lut[(d2 & 0x3f) | 0x80] +
|
|
24
|
-
_lut[(d2 >> 8) & 0xff] +
|
|
25
|
-
"-" +
|
|
26
|
-
_lut[(d2 >> 16) & 0xff] +
|
|
27
|
-
_lut[(d2 >> 24) & 0xff] +
|
|
28
|
-
_lut[d3 & 0xff] +
|
|
29
|
-
_lut[(d3 >> 8) & 0xff] +
|
|
30
|
-
_lut[(d3 >> 16) & 0xff] +
|
|
31
|
-
_lut[(d3 >> 24) & 0xff];
|
|
32
|
-
// .toLowerCase() here flattens concatenated strings to save heap memory space.
|
|
33
|
-
return uuid.toLowerCase();
|
|
29
|
+
const d0 = Math.random() * 4294967295 | 0;
|
|
30
|
+
const d1 = Math.random() * 4294967295 | 0;
|
|
31
|
+
const d2 = Math.random() * 4294967295 | 0;
|
|
32
|
+
const d3 = Math.random() * 4294967295 | 0;
|
|
33
|
+
const uuid = _lut[d0 & 255] + _lut[d0 >> 8 & 255] + _lut[d0 >> 16 & 255] + _lut[d0 >> 24 & 255] + "-" + _lut[d1 & 255] + _lut[d1 >> 8 & 255] + "-" + _lut[d1 >> 16 & 15 | 64] + _lut[d1 >> 24 & 255] + "-" + _lut[d2 & 63 | 128] + _lut[d2 >> 8 & 255] + "-" + _lut[d2 >> 16 & 255] + _lut[d2 >> 24 & 255] + _lut[d3 & 255] + _lut[d3 >> 8 & 255] + _lut[d3 >> 16 & 255] + _lut[d3 >> 24 & 255];
|
|
34
|
+
return uuid.toLowerCase();
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
var generateUUID_default = generateUUID;
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
generateUUID
|
|
40
|
+
});
|
package/dist/string/index.d.ts
CHANGED
|
@@ -1,65 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export declare const makeString: (object?: any) => string;
|
|
9
|
-
/**
|
|
10
|
-
* toUpperCase
|
|
11
|
-
*/
|
|
12
|
-
export declare const toUpperCase: (str?: string) => string;
|
|
13
|
-
/**
|
|
14
|
-
* toLowerCase
|
|
15
|
-
*/
|
|
16
|
-
export declare const toLowerCase: (str?: string) => string;
|
|
17
|
-
/**
|
|
18
|
-
* toLowerCase
|
|
19
|
-
* @param {*} str
|
|
20
|
-
* @return {string}
|
|
21
|
-
*/
|
|
22
|
-
export declare const titleize: (str?: string) => string;
|
|
23
|
-
/**
|
|
24
|
-
* Convert only first charater to UpperCase
|
|
25
|
-
*/
|
|
26
|
-
export declare const capitalize: (str: string | any, lowercaseRest?: number) => any;
|
|
27
|
-
/**
|
|
28
|
-
* Convert first character from every single words to UpperCase
|
|
29
|
-
*/
|
|
30
|
-
export declare const capitalizeName: (str: string) => string;
|
|
31
|
-
export declare const clearUnicodeCharacters: (s: string, opt?: {
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
}) => string;
|
|
34
|
-
import { makeDaySlug } from "./makeDaySlug";
|
|
35
|
-
import { generateUUID } from "./generateUUID";
|
|
36
|
-
import { formatNumber } from "./formatNumber";
|
|
37
|
-
import { generatePassword } from "./generatePassword";
|
|
38
|
-
import { trimNull } from "./trimNull";
|
|
39
|
-
declare const xstring: {
|
|
40
|
-
getBetween: (text: string, str1: string, str2?: string) => string;
|
|
41
|
-
makeString: (object?: any) => string;
|
|
42
|
-
makeDaySlug: typeof makeDaySlug;
|
|
43
|
-
toUpperCase: (str?: string) => string;
|
|
44
|
-
toLowerCase: (str?: string) => string;
|
|
45
|
-
titleize: (str?: string) => string;
|
|
46
|
-
capitalize: (str: string | any, lowercaseRest?: number) => any;
|
|
47
|
-
capitalizeName: (str: string) => string;
|
|
48
|
-
clearUnicodeCharacters: (s: string, opt?: {
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}) => string;
|
|
51
|
-
generateUUID: typeof generateUUID;
|
|
52
|
-
randAllCharacterByLength: (length?: number) => string;
|
|
53
|
-
randomStringByLength: (length: number, str?: string) => string;
|
|
54
|
-
formatNumber: typeof formatNumber;
|
|
55
|
-
generatePassword: typeof generatePassword;
|
|
56
|
-
trimNull: typeof trimNull;
|
|
57
|
-
addQueryParam: (_url: string, key: string, value: any) => string;
|
|
58
|
-
getUrlParams: (parameter: string, staticURL?: string | undefined, decode?: boolean) => string | false | undefined;
|
|
59
|
-
isLink: (str: string) => boolean;
|
|
60
|
-
getFileNameWithoutExtension: (url: string) => string | undefined;
|
|
61
|
-
getFileNameWithExtension: (url: string) => string;
|
|
62
|
-
getFileExtension: (url: string) => string | undefined;
|
|
63
|
-
isImage: (url: string) => boolean;
|
|
64
|
-
};
|
|
65
|
-
export default xstring;
|
|
1
|
+
import './makeDaySlug.js';
|
|
2
|
+
import './generateUUID.js';
|
|
3
|
+
import './formatNumber.js';
|
|
4
|
+
import './generatePassword.js';
|
|
5
|
+
import './trimNull.js';
|
|
6
|
+
export { c as capitalize, d as capitalizeName, e as clearUnicodeCharacters, x as default, g as getBetween, m as makeString, b as titleize, a as toLowerCase, t as toUpperCase } from '../index-c8fffc86.js';
|