diginext-utils 1.0.7 → 1.0.11

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 (32) 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/{src/string → string}/url.js +27 -4
  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
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
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isLink = exports.getUrlParams = exports.getFileNameWithoutExtension = exports.getFileNameWithExtension = exports.getFileExtension = void 0;
6
+ exports.isLink = exports.isImage = exports.getUrlParams = exports.getFileNameWithoutExtension = exports.getFileNameWithExtension = exports.getFileExtension = exports.addQueryParam = void 0;
7
7
 
8
8
  require("core-js/modules/es.regexp.exec.js");
9
9
 
10
- require("core-js/modules/es.string.search.js");
11
-
12
10
  require("core-js/modules/es.string.split.js");
13
11
 
12
+ require("core-js/modules/es.string.search.js");
13
+
14
14
  require("core-js/modules/es.regexp.test.js");
15
15
 
16
16
  require("core-js/modules/es.string.match.js");
@@ -21,6 +21,13 @@ var _object = require("../object");
21
21
 
22
22
  var urlRegex = /(https?:\/\/[^\s]+)/g;
23
23
 
24
+ const addQueryParam = (_url, key, value) => {
25
+ _url += (_url.split("?")[1] ? "&" : "?") + "".concat(key, "=").concat(value);
26
+ return _url;
27
+ };
28
+
29
+ exports.addQueryParam = addQueryParam;
30
+
24
31
  const getUrlParams = (parameter, staticURL, decode) => {
25
32
  if (typeof window == "undefined") return "";
26
33
  staticURL = staticURL == undefined ? window.location : staticURL;
@@ -124,5 +131,21 @@ exports.getFileNameWithExtension = getFileNameWithExtension;
124
131
  const getFileExtension = url => {
125
132
  return getFileNameWithExtension(url).split(".").pop();
126
133
  };
134
+ /**
135
+ *
136
+ * @param {string} url
137
+ * @returns
138
+ */
139
+
140
+
141
+ exports.getFileExtension = getFileExtension;
142
+
143
+ const isImage = url => {
144
+ const arr = ["png", "jpg", "jpeg", "jpe", "jif", "jfif", "gif", "svg"];
145
+ const index = arr.findIndex(item => {
146
+ return getFileExtension(url).toLowerCase() == item;
147
+ });
148
+ return index >= 0;
149
+ };
127
150
 
128
- exports.getFileExtension = getFileExtension;
151
+ 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.11",
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
- }