diginext-utils 1.0.7 → 1.0.9

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.
Files changed (33) hide show
  1. package/dist/{src/Camera.js → Camera.js} +0 -0
  2. package/dist/{src/Checker.js → Checker.js} +0 -0
  3. package/dist/{src/Color.js → Color.js} +0 -0
  4. package/dist/{src/Device.js → Device.js} +0 -0
  5. package/dist/{src/EventDispatcher.js → EventDispatcher.js} +0 -0
  6. package/dist/{src/FileUpload.js → FileUpload.js} +0 -0
  7. package/dist/{src/FileUtils.js → FileUtils.js} +0 -0
  8. package/dist/{src/Slug.js → Slug.js} +0 -0
  9. package/dist/{src/Timer.js → Timer.js} +0 -0
  10. package/dist/{src/UserLS.js → UserLS.js} +0 -0
  11. package/dist/{src/Validation.js → Validation.js} +0 -0
  12. package/dist/{src/array → array}/index.js +0 -0
  13. package/dist/{src/backend → backend}/file/createDir.js +0 -0
  14. package/dist/{src/backend → backend}/file/fileMove.js +0 -0
  15. package/dist/{src/backend → backend}/file/findFilesByExt.js +0 -0
  16. package/dist/{src/backend → backend}/zip/extractZip.js +0 -0
  17. package/dist/{src/console → console}/enableConsole.js +0 -0
  18. package/dist/{src/console → console}/index.js +0 -0
  19. package/dist/{src/device → device}/browser.js +0 -0
  20. package/dist/{src/device → device}/camera.js +0 -0
  21. package/dist/{src/device → device}/index.js +0 -0
  22. package/dist/index.js +13 -13
  23. package/dist/{src/math → math}/index.js +0 -0
  24. package/dist/{src/object → object}/index.js +0 -0
  25. package/dist/{src/permission → permission}/requestCamera.js +0 -0
  26. package/dist/{src/permission → permission}/requestDeviceOrientationControl.js +0 -0
  27. package/dist/{src/string → string}/index.js +0 -0
  28. package/dist/string/url.js +153 -0
  29. package/package.json +2 -2
  30. package/dist/README.md +0 -3
  31. package/dist/babel.config.json +0 -21
  32. package/dist/package.json +0 -35
  33. 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
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "requestDeviceOrientationControl", {
34
34
  }
35
35
  });
36
36
 
37
- var _array = require("./src/array");
37
+ var _array = require("./array");
38
38
 
39
39
  Object.keys(_array).forEach(function (key) {
40
40
  if (key === "default" || key === "__esModule") return;
@@ -48,7 +48,7 @@ Object.keys(_array).forEach(function (key) {
48
48
  });
49
49
  });
50
50
 
51
- var _device = require("./src/device");
51
+ var _device = require("./device");
52
52
 
53
53
  Object.keys(_device).forEach(function (key) {
54
54
  if (key === "default" || key === "__esModule") return;
@@ -62,7 +62,7 @@ Object.keys(_device).forEach(function (key) {
62
62
  });
63
63
  });
64
64
 
65
- var _console = require("./src/console");
65
+ var _console = require("./console");
66
66
 
67
67
  Object.keys(_console).forEach(function (key) {
68
68
  if (key === "default" || key === "__esModule") return;
@@ -76,7 +76,7 @@ Object.keys(_console).forEach(function (key) {
76
76
  });
77
77
  });
78
78
 
79
- var _browser = require("./src/device/browser");
79
+ var _browser = require("./device/browser");
80
80
 
81
81
  Object.keys(_browser).forEach(function (key) {
82
82
  if (key === "default" || key === "__esModule") return;
@@ -90,7 +90,7 @@ Object.keys(_browser).forEach(function (key) {
90
90
  });
91
91
  });
92
92
 
93
- var _camera = require("./src/device/camera");
93
+ var _camera = require("./device/camera");
94
94
 
95
95
  Object.keys(_camera).forEach(function (key) {
96
96
  if (key === "default" || key === "__esModule") return;
@@ -104,7 +104,7 @@ Object.keys(_camera).forEach(function (key) {
104
104
  });
105
105
  });
106
106
 
107
- var _math = require("./src/math");
107
+ var _math = require("./math");
108
108
 
109
109
  Object.keys(_math).forEach(function (key) {
110
110
  if (key === "default" || key === "__esModule") return;
@@ -118,7 +118,7 @@ Object.keys(_math).forEach(function (key) {
118
118
  });
119
119
  });
120
120
 
121
- var _object = require("./src/object");
121
+ var _object = require("./object");
122
122
 
123
123
  Object.keys(_object).forEach(function (key) {
124
124
  if (key === "default" || key === "__esModule") return;
@@ -132,7 +132,7 @@ Object.keys(_object).forEach(function (key) {
132
132
  });
133
133
  });
134
134
 
135
- var _string = require("./src/string");
135
+ var _string = require("./string");
136
136
 
137
137
  Object.keys(_string).forEach(function (key) {
138
138
  if (key === "default" || key === "__esModule") return;
@@ -146,7 +146,7 @@ Object.keys(_string).forEach(function (key) {
146
146
  });
147
147
  });
148
148
 
149
- var _url = require("./src/string/url");
149
+ var _url = require("./string/url");
150
150
 
151
151
  Object.keys(_url).forEach(function (key) {
152
152
  if (key === "default" || key === "__esModule") return;
@@ -160,12 +160,12 @@ Object.keys(_url).forEach(function (key) {
160
160
  });
161
161
  });
162
162
 
163
- var _Timer = _interopRequireDefault(require("./src/Timer"));
163
+ var _Timer = _interopRequireDefault(require("./Timer"));
164
164
 
165
- var _requestCamera = _interopRequireDefault(require("./src/permission/requestCamera"));
165
+ var _requestCamera = _interopRequireDefault(require("./permission/requestCamera"));
166
166
 
167
- var _requestDeviceOrientationControl = _interopRequireDefault(require("./src/permission/requestDeviceOrientationControl"));
167
+ var _requestDeviceOrientationControl = _interopRequireDefault(require("./permission/requestDeviceOrientationControl"));
168
168
 
169
- var _enableConsole = _interopRequireDefault(require("./src/console/enableConsole"));
169
+ var _enableConsole = _interopRequireDefault(require("./console/enableConsole"));
170
170
 
171
171
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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.7",
3
+ "version": "1.0.9",
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 . --out-dir dist --copy-files"
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
@@ -1,3 +0,0 @@
1
- ## Support
2
-
3
- Liên hệ [TOP GROUP Developers](mailto:dev@wearetopgroup.com) nếu cần hỗ trợ.
@@ -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.7",
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
- }
@@ -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;