diginext-utils 2.0.31 → 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,23 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
11
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// src/string/makeDaySlug.ts
|
|
27
|
+
var makeDaySlug_exports = {};
|
|
28
|
+
__export(makeDaySlug_exports, {
|
|
29
|
+
default: () => makeDaySlug_default,
|
|
30
|
+
makeDaySlug: () => makeDaySlug
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(makeDaySlug_exports);
|
|
33
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
12
34
|
function makeDaySlug(options = {}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
const { prefix = "", surfix = "", divider = "-", useDate = true, useTime = true } = options;
|
|
36
|
+
let mainStr = "";
|
|
37
|
+
if (useDate)
|
|
38
|
+
mainStr += (0, import_dayjs.default)().format(`YYYY${divider}MM${divider}DD`);
|
|
39
|
+
if (useTime)
|
|
40
|
+
mainStr += (mainStr == "" ? "" : divider) + (0, import_dayjs.default)().format(`HH${divider}mm${divider}ss`);
|
|
41
|
+
return prefix + (prefix ? divider : "") + mainStr + (surfix ? divider : "") + surfix;
|
|
20
42
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
var makeDaySlug_default = { makeDaySlug };
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
makeDaySlug
|
|
47
|
+
});
|
package/dist/string/random.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
declare const random: {
|
|
11
|
-
randAllCharacterByLength: (length?: number) => string;
|
|
12
|
-
randomStringByLength: (length: number, str?: string) => string;
|
|
1
|
+
declare const textLowCase = "abcdefghijklmnopqrstuvwxyz";
|
|
2
|
+
declare const numeric = "0123456789";
|
|
3
|
+
declare const punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
|
|
4
|
+
declare const allCharacter = "\u0111\u0110a\u00E1\u00E0\u1EA3\u00E3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u00E2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\u00E9\u00E8\u1EBB\u1EBD\u1EB9\u00EA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\u00F3\u00F2\u1ECF\u00F5\u1ECD\u00F4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\u00ED\u00EC\u1EC9\u0129\u1ECBu\u00FA\u00F9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\u00FD\u1EF3\u1EF7\u1EF9\u1EF5A\u00C1\u00C0\u1EA2\u00C3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u00C2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\u00C9\u00C8\u1EBA\u1EBC\u1EB8\u00CA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\u00D3\u00D2\u1ECE\u00D5\u1ECC\u00D4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\u00CD\u00CC\u1EC8\u0128\u1ECAU\u00DA\u00D9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\u00DD\u1EF2 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}";
|
|
5
|
+
/**
|
|
6
|
+
* allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
7
|
+
*/
|
|
8
|
+
declare const randAllCharacterByLength: (length?: number) => string;
|
|
9
|
+
declare const randomStringByLength: (length: number, str?: string) => string;
|
|
10
|
+
declare const random: {
|
|
11
|
+
randAllCharacterByLength: (length?: number) => string;
|
|
12
|
+
randomStringByLength: (length: number, str?: string) => string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
export { allCharacter, random as default, numeric, punctuation, randAllCharacterByLength, randomStringByLength, textLowCase };
|
package/dist/string/random.js
CHANGED
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* allCharacter = `đĐaáàảãạăắằẳẵặâấầẩẫậeéèẻẽẹêếềểễệoóòỏõọôốồổỗộơớờởỡợiíìỉĩịuúùủũụưứừửữựyýỳỷỹỵAÁÀẢÃẠĂẮẰẲẴẶÂẤẦẨẪẬEÉÈẺẼẸÊẾỀỂỄỆOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢIÍÌỈĨỊUÚÙỦŨỤƯỨỪỬỮỰYÝỲ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
10
|
-
*/
|
|
11
|
-
const randAllCharacterByLength = (length = 0) => {
|
|
12
|
-
return (0, exports.randomStringByLength)(length, exports.allCharacter);
|
|
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 });
|
|
13
9
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
|
21
17
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/string/random.ts
|
|
21
|
+
var random_exports = {};
|
|
22
|
+
__export(random_exports, {
|
|
23
|
+
allCharacter: () => allCharacter,
|
|
24
|
+
default: () => random_default,
|
|
25
|
+
numeric: () => numeric,
|
|
26
|
+
punctuation: () => punctuation,
|
|
27
|
+
randAllCharacterByLength: () => randAllCharacterByLength,
|
|
28
|
+
randomStringByLength: () => randomStringByLength,
|
|
29
|
+
textLowCase: () => textLowCase
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(random_exports);
|
|
32
|
+
var textLowCase = "abcdefghijklmnopqrstuvwxyz";
|
|
33
|
+
var numeric = "0123456789";
|
|
34
|
+
var punctuation = "!@#$%^&*()_+~|}{[];?><,./-=";
|
|
35
|
+
var allCharacter = `\u0111\u0110a\xE1\xE0\u1EA3\xE3\u1EA1\u0103\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\xE2\u1EA5\u1EA7\u1EA9\u1EAB\u1EADe\xE9\xE8\u1EBB\u1EBD\u1EB9\xEA\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7o\xF3\xF2\u1ECF\xF5\u1ECD\xF4\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u01A1\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3i\xED\xEC\u1EC9\u0129\u1ECBu\xFA\xF9\u1EE7\u0169\u1EE5\u01B0\u1EE9\u1EEB\u1EED\u1EEF\u1EF1y\xFD\u1EF3\u1EF7\u1EF9\u1EF5A\xC1\xC0\u1EA2\xC3\u1EA0\u0102\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\xC2\u1EA4\u1EA6\u1EA8\u1EAA\u1EACE\xC9\xC8\u1EBA\u1EBC\u1EB8\xCA\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6O\xD3\xD2\u1ECE\xD5\u1ECC\xD4\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u01A0\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2I\xCD\xCC\u1EC8\u0128\u1ECAU\xDA\xD9\u1EE6\u0168\u1EE4\u01AF\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0Y\xDD\u1EF2 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_\`abcdefghijklmnopqrstuvwxyz{|}`;
|
|
36
|
+
var randAllCharacterByLength = (length = 0) => {
|
|
37
|
+
return randomStringByLength(length, allCharacter);
|
|
38
|
+
};
|
|
39
|
+
var randomStringByLength = (length, str = textLowCase) => {
|
|
40
|
+
let result = "";
|
|
41
|
+
for (let i = 0; i < length; i++) {
|
|
42
|
+
result += str.charAt(Math.floor(Math.random() * str.length));
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
var random = { randAllCharacterByLength, randomStringByLength };
|
|
47
|
+
var random_default = random;
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
allCharacter,
|
|
51
|
+
numeric,
|
|
52
|
+
punctuation,
|
|
53
|
+
randAllCharacterByLength,
|
|
54
|
+
randomStringByLength,
|
|
55
|
+
textLowCase
|
|
56
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
allCharacter,
|
|
3
|
+
numeric,
|
|
4
|
+
punctuation,
|
|
5
|
+
randAllCharacterByLength,
|
|
6
|
+
randomStringByLength,
|
|
7
|
+
random_default,
|
|
8
|
+
textLowCase
|
|
9
|
+
} from "../chunk-KPO3RH5G.mjs";
|
|
10
|
+
import "../chunk-ZHNGZMRD.mjs";
|
|
11
|
+
export {
|
|
12
|
+
allCharacter,
|
|
13
|
+
random_default as default,
|
|
14
|
+
numeric,
|
|
15
|
+
punctuation,
|
|
16
|
+
randAllCharacterByLength,
|
|
17
|
+
randomStringByLength,
|
|
18
|
+
textLowCase
|
|
19
|
+
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function trimNull(str: string): string;
|
|
2
|
+
|
|
3
|
+
export { trimNull as default, trimNull };
|
package/dist/string/trimNull.js
CHANGED
|
@@ -1,21 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
11
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
|
|
26
|
+
// src/string/trimNull.ts
|
|
27
|
+
var trimNull_exports = {};
|
|
28
|
+
__export(trimNull_exports, {
|
|
29
|
+
default: () => trimNull_default,
|
|
30
|
+
trimNull: () => trimNull
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(trimNull_exports);
|
|
33
|
+
var import_trim = __toESM(require("lodash/trim"));
|
|
8
34
|
function trimNull(str) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
35
|
+
if (!str)
|
|
36
|
+
return "";
|
|
37
|
+
str = str.toString();
|
|
38
|
+
str = str.replace(/\0/g, "");
|
|
39
|
+
while (str.indexOf(" ") >= 0) {
|
|
40
|
+
str = str.replaceAll(" ", " ");
|
|
41
|
+
}
|
|
42
|
+
str = (0, import_trim.default)(str);
|
|
43
|
+
return str;
|
|
18
44
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
45
|
+
var trimNull_default = trimNull;
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
trimNull
|
|
49
|
+
});
|
package/dist/string/url.d.ts
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @return {boolean}
|
|
6
|
-
*/
|
|
7
|
-
export declare const isLink: (str: string) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {string} url
|
|
11
|
-
* @return {string}
|
|
12
|
-
*/
|
|
13
|
-
export declare const getFileNameWithoutExtension: (url: string) => string | undefined;
|
|
14
|
-
export declare const getFileNameWithExtension: (url: string) => string;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {string} url
|
|
18
|
-
* @return {string}
|
|
19
|
-
*/
|
|
20
|
-
export declare const getFileExtension: (url: string) => string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param {string} url
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
export declare const isImage: (url: string) => boolean;
|
|
27
|
-
declare const xurl: {
|
|
28
|
-
addQueryParam: (_url: string, key: string, value: any) => string;
|
|
29
|
-
getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
30
|
-
isLink: (str: string) => boolean;
|
|
31
|
-
getFileNameWithoutExtension: (url: string) => string | undefined;
|
|
32
|
-
getFileNameWithExtension: (url: string) => string;
|
|
33
|
-
getFileExtension: (url: string) => string | undefined;
|
|
34
|
-
isImage: (url: string) => boolean;
|
|
35
|
-
};
|
|
36
|
-
export default xurl;
|
|
1
|
+
export { a as addQueryParam, x as default, d as getFileExtension, c as getFileNameWithExtension, b as getFileNameWithoutExtension, g as getUrlParams, e as isImage, i as isLink } from '../url-60657387.js';
|
package/dist/string/url.js
CHANGED
|
@@ -1,108 +1,126 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
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/url.ts
|
|
21
|
+
var url_exports = {};
|
|
22
|
+
__export(url_exports, {
|
|
23
|
+
addQueryParam: () => addQueryParam,
|
|
24
|
+
default: () => url_default,
|
|
25
|
+
getFileExtension: () => getFileExtension,
|
|
26
|
+
getFileNameWithExtension: () => getFileNameWithExtension,
|
|
27
|
+
getFileNameWithoutExtension: () => getFileNameWithoutExtension,
|
|
28
|
+
getUrlParams: () => getUrlParams,
|
|
29
|
+
isImage: () => isImage,
|
|
30
|
+
isLink: () => isLink
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(url_exports);
|
|
33
|
+
|
|
34
|
+
// src/object.ts
|
|
35
|
+
var isNull = (object) => {
|
|
36
|
+
if (typeof object == "undefined")
|
|
37
|
+
return true;
|
|
38
|
+
if (object == "")
|
|
39
|
+
return true;
|
|
40
|
+
if (Array.isArray(object))
|
|
41
|
+
return object.length == 0;
|
|
42
|
+
if (JSON.stringify(object) == "{}")
|
|
43
|
+
return true;
|
|
44
|
+
return object == null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/string/url.ts
|
|
5
48
|
var urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
49
|
+
var addQueryParam = (_url, key, value) => {
|
|
50
|
+
_url += (_url.split("?")[1] ? "&" : "?") + `${key}=${value}`;
|
|
51
|
+
return _url;
|
|
9
52
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
else {
|
|
26
|
-
returnBool = false;
|
|
27
|
-
}
|
|
53
|
+
var getUrlParams = (parameter, staticURL, decode = true) => {
|
|
54
|
+
if (typeof window == "undefined")
|
|
55
|
+
return "";
|
|
56
|
+
staticURL = staticURL == void 0 ? window.location.host : staticURL;
|
|
57
|
+
var currLocation = staticURL.length > 0 ? staticURL : window.location.search;
|
|
58
|
+
if (currLocation.split("?").length < 2)
|
|
59
|
+
return "";
|
|
60
|
+
var parArr = currLocation.split("?")[1].split("&"), returnBool = true;
|
|
61
|
+
for (var i = 0; i < parArr.length; i++) {
|
|
62
|
+
var parr = parArr[i].split("=");
|
|
63
|
+
if (parr[0] == parameter) {
|
|
64
|
+
return decode ? decodeURIComponent(parr[1]) : parr[1];
|
|
65
|
+
returnBool = true;
|
|
66
|
+
} else {
|
|
67
|
+
returnBool = false;
|
|
28
68
|
}
|
|
29
|
-
|
|
30
|
-
|
|
69
|
+
}
|
|
70
|
+
if (!returnBool)
|
|
71
|
+
return false;
|
|
31
72
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
* @return {boolean}
|
|
36
|
-
*/
|
|
37
|
-
const isLink = (str) => {
|
|
38
|
-
return urlRegex.test(str);
|
|
73
|
+
var isLink = (str) => {
|
|
74
|
+
return urlRegex.test(str);
|
|
39
75
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// return isLink(str) ? <a href={src}>{altText || src}</a> : str;
|
|
47
|
-
// };
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {string} url
|
|
51
|
-
* @return {string}
|
|
52
|
-
*/
|
|
53
|
-
const getFileNameWithoutExtension = (url) => {
|
|
54
|
-
url = decodeURIComponent(url);
|
|
55
|
-
if (url) {
|
|
56
|
-
const m = url.toString().match(/.*\/(.+?)\./);
|
|
57
|
-
if (m && m.length > 1) {
|
|
58
|
-
return m[1];
|
|
59
|
-
}
|
|
60
|
-
if (!(0, object_1.isNull)(url)) {
|
|
61
|
-
return url.split(".").shift();
|
|
62
|
-
}
|
|
76
|
+
var getFileNameWithoutExtension = (url) => {
|
|
77
|
+
url = decodeURIComponent(url);
|
|
78
|
+
if (url) {
|
|
79
|
+
const m = url.toString().match(/.*\/(.+?)\./);
|
|
80
|
+
if (m && m.length > 1) {
|
|
81
|
+
return m[1];
|
|
63
82
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
|
|
67
|
-
const getFileNameWithExtension = (url) => {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
const _url = decodeURIComponent(url);
|
|
70
|
-
const m = _url.toString().match(/.*\/(.*)$/) || [];
|
|
71
|
-
if (typeof m != "undefined" && (m === null || m === void 0 ? void 0 : m.length) > 1) {
|
|
72
|
-
const a = ((_a = m === null || m === void 0 ? void 0 : m[1].split("/")) === null || _a === void 0 ? void 0 : _a.pop()) || "";
|
|
73
|
-
const b = (_b = a.split("?")) === null || _b === void 0 ? void 0 : _b.shift();
|
|
74
|
-
return b || (m === null || m === void 0 ? void 0 : m[1]) || "";
|
|
83
|
+
if (!isNull(url)) {
|
|
84
|
+
return url.split(".").shift();
|
|
75
85
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
}
|
|
87
|
+
return "";
|
|
88
|
+
};
|
|
89
|
+
var getFileNameWithExtension = (url) => {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
const _url = decodeURIComponent(url);
|
|
92
|
+
const m = _url.toString().match(/.*\/(.*)$/) || [];
|
|
93
|
+
if (typeof m != "undefined" && (m == null ? void 0 : m.length) > 1) {
|
|
94
|
+
const a = ((_a = m == null ? void 0 : m[1].split("/")) == null ? void 0 : _a.pop()) || "";
|
|
95
|
+
const b = (_b = a.split("?")) == null ? void 0 : _b.shift();
|
|
96
|
+
return b || (m == null ? void 0 : m[1]) || "";
|
|
97
|
+
}
|
|
98
|
+
if (!isNull(_url))
|
|
99
|
+
return url;
|
|
100
|
+
return "";
|
|
79
101
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
*
|
|
83
|
-
* @param {string} url
|
|
84
|
-
* @return {string}
|
|
85
|
-
*/
|
|
86
|
-
const getFileExtension = (url) => {
|
|
87
|
-
return (0, exports.getFileNameWithExtension)(url).split(".").pop();
|
|
102
|
+
var getFileExtension = (url) => {
|
|
103
|
+
return getFileNameWithExtension(url).split(".").pop();
|
|
88
104
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const arr = ["png", "jpg", "jpeg", "jpe", "jif", "jfif", "gif", "svg"];
|
|
99
|
-
const index = arr.findIndex((item) => {
|
|
100
|
-
var _a;
|
|
101
|
-
return ((_a = (0, exports.getFileExtension)(url)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == item;
|
|
102
|
-
});
|
|
103
|
-
return index >= 0;
|
|
105
|
+
var isImage = (url) => {
|
|
106
|
+
if (!url)
|
|
107
|
+
return false;
|
|
108
|
+
const arr = ["png", "jpg", "jpeg", "jpe", "jif", "jfif", "gif", "svg"];
|
|
109
|
+
const index = arr.findIndex((item) => {
|
|
110
|
+
var _a;
|
|
111
|
+
return ((_a = getFileExtension(url)) == null ? void 0 : _a.toLowerCase()) == item;
|
|
112
|
+
});
|
|
113
|
+
return index >= 0;
|
|
104
114
|
};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
115
|
+
var xurl = { addQueryParam, getUrlParams, isLink, getFileNameWithoutExtension, getFileNameWithExtension, getFileExtension, isImage };
|
|
116
|
+
var url_default = xurl;
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
addQueryParam,
|
|
120
|
+
getFileExtension,
|
|
121
|
+
getFileNameWithExtension,
|
|
122
|
+
getFileNameWithoutExtension,
|
|
123
|
+
getUrlParams,
|
|
124
|
+
isImage,
|
|
125
|
+
isLink
|
|
126
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addQueryParam,
|
|
3
|
+
getFileExtension,
|
|
4
|
+
getFileNameWithExtension,
|
|
5
|
+
getFileNameWithoutExtension,
|
|
6
|
+
getUrlParams,
|
|
7
|
+
isImage,
|
|
8
|
+
isLink,
|
|
9
|
+
url_default
|
|
10
|
+
} from "../chunk-KWG5LYNK.mjs";
|
|
11
|
+
import "../chunk-5UEMANWE.mjs";
|
|
12
|
+
import "../chunk-ZHNGZMRD.mjs";
|
|
13
|
+
export {
|
|
14
|
+
addQueryParam,
|
|
15
|
+
url_default as default,
|
|
16
|
+
getFileExtension,
|
|
17
|
+
getFileNameWithExtension,
|
|
18
|
+
getFileNameWithoutExtension,
|
|
19
|
+
getUrlParams,
|
|
20
|
+
isImage,
|
|
21
|
+
isLink
|
|
22
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare const addQueryParam: (_url: string, key: string, value: any) => string;
|
|
2
|
+
declare const getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @return {boolean}
|
|
6
|
+
*/
|
|
7
|
+
declare const isLink: (str: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {string} url
|
|
11
|
+
* @return {string}
|
|
12
|
+
*/
|
|
13
|
+
declare const getFileNameWithoutExtension: (url: string) => string | undefined;
|
|
14
|
+
declare const getFileNameWithExtension: (url: string) => string;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {string} url
|
|
18
|
+
* @return {string}
|
|
19
|
+
*/
|
|
20
|
+
declare const getFileExtension: (url: string) => string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {string} url
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
declare const isImage: (url: string) => boolean;
|
|
27
|
+
declare const xurl: {
|
|
28
|
+
addQueryParam: (_url: string, key: string, value: any) => string;
|
|
29
|
+
getUrlParams: (parameter: string, staticURL?: string, decode?: boolean) => string | false | undefined;
|
|
30
|
+
isLink: (str: string) => boolean;
|
|
31
|
+
getFileNameWithoutExtension: (url: string) => string | undefined;
|
|
32
|
+
getFileNameWithExtension: (url: string) => string;
|
|
33
|
+
getFileExtension: (url: string) => string | undefined;
|
|
34
|
+
isImage: (url: string) => boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
declare const url_addQueryParam: typeof addQueryParam;
|
|
38
|
+
declare const url_getFileExtension: typeof getFileExtension;
|
|
39
|
+
declare const url_getFileNameWithExtension: typeof getFileNameWithExtension;
|
|
40
|
+
declare const url_getFileNameWithoutExtension: typeof getFileNameWithoutExtension;
|
|
41
|
+
declare const url_getUrlParams: typeof getUrlParams;
|
|
42
|
+
declare const url_isImage: typeof isImage;
|
|
43
|
+
declare const url_isLink: typeof isLink;
|
|
44
|
+
declare namespace url {
|
|
45
|
+
export {
|
|
46
|
+
url_addQueryParam as addQueryParam,
|
|
47
|
+
xurl as default,
|
|
48
|
+
url_getFileExtension as getFileExtension,
|
|
49
|
+
url_getFileNameWithExtension as getFileNameWithExtension,
|
|
50
|
+
url_getFileNameWithoutExtension as getFileNameWithoutExtension,
|
|
51
|
+
url_getUrlParams as getUrlParams,
|
|
52
|
+
url_isImage as isImage,
|
|
53
|
+
url_isLink as isLink,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { addQueryParam as a, getFileNameWithoutExtension as b, getFileNameWithExtension as c, getFileExtension as d, isImage as e, getUrlParams as g, isLink as i, url as u, xurl as x };
|