diginext-utils 1.0.6 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{src/Camera.js → Camera.js} +0 -0
- package/dist/{src/Checker.js → Checker.js} +0 -0
- package/dist/{src/Color.js → Color.js} +0 -0
- package/dist/{src/Device.js → Device.js} +0 -0
- package/dist/{src/EventDispatcher.js → EventDispatcher.js} +0 -0
- package/dist/{src/FileUpload.js → FileUpload.js} +0 -0
- package/dist/{src/FileUtils.js → FileUtils.js} +0 -0
- package/dist/{src/Slug.js → Slug.js} +0 -0
- package/dist/{src/Timer.js → Timer.js} +0 -0
- package/dist/{src/UserLS.js → UserLS.js} +0 -0
- package/dist/{src/Validation.js → Validation.js} +0 -0
- package/dist/{src/array → array}/index.js +0 -0
- package/dist/{src/backend → backend}/file/createDir.js +0 -0
- package/dist/{src/backend → backend}/file/fileMove.js +0 -0
- package/dist/{src/backend → backend}/file/findFilesByExt.js +0 -0
- package/dist/{src/backend → backend}/zip/extractZip.js +0 -0
- package/dist/{src/console → console}/enableConsole.js +0 -0
- package/dist/{src/console → console}/index.js +0 -0
- package/dist/{src/device → device}/browser.js +0 -0
- package/dist/{src/device → device}/camera.js +0 -0
- package/dist/{src/device → device}/index.js +0 -0
- package/dist/index.js +35 -12
- package/dist/{src/math → math}/index.js +0 -0
- package/dist/{src/object → object}/index.js +0 -0
- package/dist/{src/permission → permission}/requestCamera.js +0 -0
- package/dist/{src/permission → permission}/requestDeviceOrientationControl.js +0 -0
- package/dist/{src/string → string}/index.js +0 -0
- package/dist/string/url.js +153 -0
- package/package.json +2 -2
- package/dist/README.md +0 -3
- package/dist/babel.config.json +0 -21
- package/dist/package.json +0 -35
- package/dist/src/string/url.js +0 -128
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Timer: true,
|
|
8
8
|
requestCamera: true,
|
|
9
|
-
requestDeviceOrientationControl: true
|
|
9
|
+
requestDeviceOrientationControl: true,
|
|
10
|
+
enableConsole: true
|
|
10
11
|
};
|
|
11
12
|
Object.defineProperty(exports, "Timer", {
|
|
12
13
|
enumerable: true,
|
|
@@ -14,6 +15,12 @@ Object.defineProperty(exports, "Timer", {
|
|
|
14
15
|
return _Timer.default;
|
|
15
16
|
}
|
|
16
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "enableConsole", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _enableConsole.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
17
24
|
Object.defineProperty(exports, "requestCamera", {
|
|
18
25
|
enumerable: true,
|
|
19
26
|
get: function get() {
|
|
@@ -27,7 +34,7 @@ Object.defineProperty(exports, "requestDeviceOrientationControl", {
|
|
|
27
34
|
}
|
|
28
35
|
});
|
|
29
36
|
|
|
30
|
-
var _array = require("./
|
|
37
|
+
var _array = require("./array");
|
|
31
38
|
|
|
32
39
|
Object.keys(_array).forEach(function (key) {
|
|
33
40
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -41,7 +48,7 @@ Object.keys(_array).forEach(function (key) {
|
|
|
41
48
|
});
|
|
42
49
|
});
|
|
43
50
|
|
|
44
|
-
var _device = require("./
|
|
51
|
+
var _device = require("./device");
|
|
45
52
|
|
|
46
53
|
Object.keys(_device).forEach(function (key) {
|
|
47
54
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -55,7 +62,21 @@ Object.keys(_device).forEach(function (key) {
|
|
|
55
62
|
});
|
|
56
63
|
});
|
|
57
64
|
|
|
58
|
-
var
|
|
65
|
+
var _console = require("./console");
|
|
66
|
+
|
|
67
|
+
Object.keys(_console).forEach(function (key) {
|
|
68
|
+
if (key === "default" || key === "__esModule") return;
|
|
69
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
70
|
+
if (key in exports && exports[key] === _console[key]) return;
|
|
71
|
+
Object.defineProperty(exports, key, {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function get() {
|
|
74
|
+
return _console[key];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
var _browser = require("./device/browser");
|
|
59
80
|
|
|
60
81
|
Object.keys(_browser).forEach(function (key) {
|
|
61
82
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -69,7 +90,7 @@ Object.keys(_browser).forEach(function (key) {
|
|
|
69
90
|
});
|
|
70
91
|
});
|
|
71
92
|
|
|
72
|
-
var _camera = require("./
|
|
93
|
+
var _camera = require("./device/camera");
|
|
73
94
|
|
|
74
95
|
Object.keys(_camera).forEach(function (key) {
|
|
75
96
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -83,7 +104,7 @@ Object.keys(_camera).forEach(function (key) {
|
|
|
83
104
|
});
|
|
84
105
|
});
|
|
85
106
|
|
|
86
|
-
var _math = require("./
|
|
107
|
+
var _math = require("./math");
|
|
87
108
|
|
|
88
109
|
Object.keys(_math).forEach(function (key) {
|
|
89
110
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -97,7 +118,7 @@ Object.keys(_math).forEach(function (key) {
|
|
|
97
118
|
});
|
|
98
119
|
});
|
|
99
120
|
|
|
100
|
-
var _object = require("./
|
|
121
|
+
var _object = require("./object");
|
|
101
122
|
|
|
102
123
|
Object.keys(_object).forEach(function (key) {
|
|
103
124
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -111,7 +132,7 @@ Object.keys(_object).forEach(function (key) {
|
|
|
111
132
|
});
|
|
112
133
|
});
|
|
113
134
|
|
|
114
|
-
var _string = require("./
|
|
135
|
+
var _string = require("./string");
|
|
115
136
|
|
|
116
137
|
Object.keys(_string).forEach(function (key) {
|
|
117
138
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -125,7 +146,7 @@ Object.keys(_string).forEach(function (key) {
|
|
|
125
146
|
});
|
|
126
147
|
});
|
|
127
148
|
|
|
128
|
-
var _url = require("./
|
|
149
|
+
var _url = require("./string/url");
|
|
129
150
|
|
|
130
151
|
Object.keys(_url).forEach(function (key) {
|
|
131
152
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -139,10 +160,12 @@ Object.keys(_url).forEach(function (key) {
|
|
|
139
160
|
});
|
|
140
161
|
});
|
|
141
162
|
|
|
142
|
-
var _Timer = _interopRequireDefault(require("./
|
|
163
|
+
var _Timer = _interopRequireDefault(require("./Timer"));
|
|
164
|
+
|
|
165
|
+
var _requestCamera = _interopRequireDefault(require("./permission/requestCamera"));
|
|
143
166
|
|
|
144
|
-
var
|
|
167
|
+
var _requestDeviceOrientationControl = _interopRequireDefault(require("./permission/requestDeviceOrientationControl"));
|
|
145
168
|
|
|
146
|
-
var
|
|
169
|
+
var _enableConsole = _interopRequireDefault(require("./console/enableConsole"));
|
|
147
170
|
|
|
148
171
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
exports.isLink =
|
|
7
|
+
exports.isImage =
|
|
8
|
+
exports.getUrlParams =
|
|
9
|
+
exports.getFileNameWithoutExtension =
|
|
10
|
+
exports.getFileNameWithExtension =
|
|
11
|
+
exports.getFileExtension =
|
|
12
|
+
exports.addQueryParam =
|
|
13
|
+
void 0;
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.string.split.js");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.string.search.js");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/es.regexp.test.js");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/es.string.match.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.regexp.to-string.js");
|
|
26
|
+
|
|
27
|
+
var _object = require("../object");
|
|
28
|
+
|
|
29
|
+
var urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
30
|
+
|
|
31
|
+
const addQueryParam = (_url, key, value) => {
|
|
32
|
+
_url += (_url.split("?")[1] ? "&" : "?") + "".concat(key, "=").concat(value);
|
|
33
|
+
return _url;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.addQueryParam = addQueryParam;
|
|
37
|
+
|
|
38
|
+
const getUrlParams = (parameter, staticURL, decode) => {
|
|
39
|
+
if (typeof window == "undefined") return "";
|
|
40
|
+
staticURL = staticURL == undefined ? window.location : staticURL;
|
|
41
|
+
var currLocation = staticURL.length ? staticURL : window.location.search;
|
|
42
|
+
if (currLocation.split("?").length < 2) return "";
|
|
43
|
+
var parArr = currLocation.split("?")[1].split("&"),
|
|
44
|
+
returnBool = true;
|
|
45
|
+
|
|
46
|
+
for (var i = 0; i < parArr.length; i++) {
|
|
47
|
+
var parr = parArr[i].split("=");
|
|
48
|
+
|
|
49
|
+
if (parr[0] == parameter) {
|
|
50
|
+
return decode ? decodeURIComponent(parr[1]) : parr[1];
|
|
51
|
+
returnBool = true;
|
|
52
|
+
} else {
|
|
53
|
+
returnBool = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!returnBool) return false;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @return {boolean}
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
exports.getUrlParams = getUrlParams;
|
|
65
|
+
|
|
66
|
+
const isLink = (str) => {
|
|
67
|
+
return urlRegex.test(str);
|
|
68
|
+
}; // /**
|
|
69
|
+
// *
|
|
70
|
+
// * @return {JSX.Element}
|
|
71
|
+
// */
|
|
72
|
+
// export const strToJsxLink = (str, altText) => {
|
|
73
|
+
// return isLink(str) ? <a href={src}>{altText || src}</a> : str;
|
|
74
|
+
// };
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @param {string} url
|
|
79
|
+
* @return {string}
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
exports.isLink = isLink;
|
|
83
|
+
|
|
84
|
+
const getFileNameWithoutExtension = (url) => {
|
|
85
|
+
url = decodeURIComponent(url);
|
|
86
|
+
|
|
87
|
+
if (url) {
|
|
88
|
+
const m = url.toString().match(/.*\/(.+?)\./);
|
|
89
|
+
|
|
90
|
+
if (m && m.length > 1) {
|
|
91
|
+
return m[1];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (!(0, _object.isNull)(url)) {
|
|
95
|
+
return url.split(".").shift();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return "";
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @param {string} url
|
|
104
|
+
* @return {string}
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
|
|
108
|
+
|
|
109
|
+
const getFileNameWithExtension = (url) => {
|
|
110
|
+
url = decodeURIComponent(url);
|
|
111
|
+
|
|
112
|
+
if (url) {
|
|
113
|
+
const m = url.toString().match(/.*\/(.*)$/);
|
|
114
|
+
|
|
115
|
+
if (m && m.length > 1) {
|
|
116
|
+
return m[1].split("/").pop().split("?")[0];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (!(0, _object.isNull)(url)) {
|
|
120
|
+
return url;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return "";
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @param {string} url
|
|
129
|
+
* @return {string}
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
exports.getFileNameWithExtension = getFileNameWithExtension;
|
|
133
|
+
|
|
134
|
+
const getFileExtension = (url) => {
|
|
135
|
+
return getFileNameWithExtension(url).split(".").pop();
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param {string} url
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
exports.getFileExtension = getFileExtension;
|
|
144
|
+
|
|
145
|
+
const isImage = (url) => {
|
|
146
|
+
const arr = ["png", "jpg", "jpeg", "jpe", "jif", "jfif", "gif", "svg"];
|
|
147
|
+
const index = arr.findIndex((item) => {
|
|
148
|
+
return (void 0).getFileExtension(url).toLowerCase() == item;
|
|
149
|
+
});
|
|
150
|
+
return index >= 0;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
exports.isImage = isImage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diginext-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "TOP GROUP (a.k.a Digitop)",
|
|
6
6
|
"email": "dev@wearetopgroup.com"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"publish": "npm publish",
|
|
16
16
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
17
|
-
"build": "rm -rf dist && NODE_ENV=production babel
|
|
17
|
+
"build": "rm -rf dist && NODE_ENV=production babel src --out-dir dist --copy-files"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/polyfill": "^7.12.1",
|
package/dist/README.md
DELETED
package/dist/babel.config.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/env",
|
|
5
|
-
{
|
|
6
|
-
"targets": {
|
|
7
|
-
"edge": "17",
|
|
8
|
-
"firefox": "60",
|
|
9
|
-
"chrome": "67",
|
|
10
|
-
"safari": "11.1"
|
|
11
|
-
},
|
|
12
|
-
"useBuiltIns": "usage",
|
|
13
|
-
"corejs": "3.6.5"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"@babel/preset-react"
|
|
17
|
-
],
|
|
18
|
-
"ignore": [
|
|
19
|
-
"node_modules"
|
|
20
|
-
]
|
|
21
|
-
}
|
package/dist/package.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "diginext-utils",
|
|
3
|
-
"version": "1.0.6",
|
|
4
|
-
"author": {
|
|
5
|
-
"name": "TOP GROUP (a.k.a Digitop)",
|
|
6
|
-
"email": "dev@wearetopgroup.com"
|
|
7
|
-
},
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"module": "dist/index.js",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"README.md"
|
|
13
|
-
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"publish": "npm publish",
|
|
16
|
-
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
17
|
-
"build": "rm -rf dist && NODE_ENV=production babel . --out-dir dist --copy-files"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@babel/polyfill": "^7.12.1",
|
|
21
|
-
"@babel/preset-react": "^7.18.6",
|
|
22
|
-
"@babel/runtime": "^7.18.9",
|
|
23
|
-
"core-js": "^3.24.1",
|
|
24
|
-
"gsap": "^3.10.4",
|
|
25
|
-
"lodash": "^4.17.21"
|
|
26
|
-
},
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@babel/cli": "^7.18.10",
|
|
32
|
-
"@babel/core": "^7.18.10",
|
|
33
|
-
"@babel/preset-env": "^7.18.10"
|
|
34
|
-
}
|
|
35
|
-
}
|
package/dist/src/string/url.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isLink = exports.getUrlParams = exports.getFileNameWithoutExtension = exports.getFileNameWithExtension = exports.getFileExtension = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.string.search.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.string.split.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.regexp.test.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.string.match.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
19
|
-
|
|
20
|
-
var _object = require("../object");
|
|
21
|
-
|
|
22
|
-
var urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
23
|
-
|
|
24
|
-
const getUrlParams = (parameter, staticURL, decode) => {
|
|
25
|
-
if (typeof window == "undefined") return "";
|
|
26
|
-
staticURL = staticURL == undefined ? window.location : staticURL;
|
|
27
|
-
var currLocation = staticURL.length ? staticURL : window.location.search;
|
|
28
|
-
if (currLocation.split("?").length < 2) return "";
|
|
29
|
-
var parArr = currLocation.split("?")[1].split("&"),
|
|
30
|
-
returnBool = true;
|
|
31
|
-
|
|
32
|
-
for (var i = 0; i < parArr.length; i++) {
|
|
33
|
-
var parr = parArr[i].split("=");
|
|
34
|
-
|
|
35
|
-
if (parr[0] == parameter) {
|
|
36
|
-
return decode ? decodeURIComponent(parr[1]) : parr[1];
|
|
37
|
-
returnBool = true;
|
|
38
|
-
} else {
|
|
39
|
-
returnBool = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!returnBool) return false;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @return {boolean}
|
|
48
|
-
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
exports.getUrlParams = getUrlParams;
|
|
52
|
-
|
|
53
|
-
const isLink = str => {
|
|
54
|
-
return urlRegex.test(str);
|
|
55
|
-
}; // /**
|
|
56
|
-
// *
|
|
57
|
-
// * @return {JSX.Element}
|
|
58
|
-
// */
|
|
59
|
-
// export const strToJsxLink = (str, altText) => {
|
|
60
|
-
// return isLink(str) ? <a href={src}>{altText || src}</a> : str;
|
|
61
|
-
// };
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @param {string} url
|
|
66
|
-
* @return {string}
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
exports.isLink = isLink;
|
|
71
|
-
|
|
72
|
-
const getFileNameWithoutExtension = url => {
|
|
73
|
-
url = decodeURIComponent(url);
|
|
74
|
-
|
|
75
|
-
if (url) {
|
|
76
|
-
const m = url.toString().match(/.*\/(.+?)\./);
|
|
77
|
-
|
|
78
|
-
if (m && m.length > 1) {
|
|
79
|
-
return m[1];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!(0, _object.isNull)(url)) {
|
|
83
|
-
return url.split(".").shift();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return "";
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
*
|
|
91
|
-
* @param {string} url
|
|
92
|
-
* @return {string}
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
exports.getFileNameWithoutExtension = getFileNameWithoutExtension;
|
|
97
|
-
|
|
98
|
-
const getFileNameWithExtension = url => {
|
|
99
|
-
url = decodeURIComponent(url);
|
|
100
|
-
|
|
101
|
-
if (url) {
|
|
102
|
-
const m = url.toString().match(/.*\/(.*)$/);
|
|
103
|
-
|
|
104
|
-
if (m && m.length > 1) {
|
|
105
|
-
return m[1].split("/").pop().split("?")[0];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (!(0, _object.isNull)(url)) {
|
|
109
|
-
return url;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return "";
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
* @param {string} url
|
|
118
|
-
* @return {string}
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
exports.getFileNameWithExtension = getFileNameWithExtension;
|
|
123
|
-
|
|
124
|
-
const getFileExtension = url => {
|
|
125
|
-
return getFileNameWithExtension(url).split(".").pop();
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
exports.getFileExtension = getFileExtension;
|