diginext-utils 1.0.2 → 1.0.3
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/babel.config.json +21 -0
- package/dist/Camera.js +420 -0
- package/dist/Checker.js +34 -0
- package/dist/Color.js +102 -0
- package/dist/Device.js +67 -0
- package/dist/EventDispatcher.js +62 -0
- package/dist/FileUpload.js +73 -0
- package/dist/FileUtils.js +47 -0
- package/dist/Slug.js +384 -0
- package/dist/Timer.js +16 -0
- package/dist/UserLS.js +127 -0
- package/dist/Validation.js +46 -0
- package/dist/array/index.js +377 -0
- package/dist/backend/file/createDir.js +24 -0
- package/dist/backend/file/fileMove.js +42 -0
- package/dist/backend/file/findFilesByExt.js +55 -0
- package/dist/backend/zip/extractZip.js +55 -0
- package/dist/console/enableConsole.js +16 -0
- package/dist/console/index.js +20 -0
- package/dist/device/browser.js +52 -0
- package/dist/device/camera.js +238 -0
- package/dist/device/index.js +304 -0
- package/dist/math/index.js +209 -0
- package/dist/object/index.js +65 -0
- package/dist/permission/requestCamera.js +55 -0
- package/dist/permission/requestDeviceOrientationControl.js +36 -0
- package/dist/string/index.js +531 -0
- package/dist/string/url.js +128 -0
- package/package.json +13 -13
- package/src/backend/zip/extractZip.js +54 -54
- package/dist/main.js +0 -1611
- package/dist/main.js.map +0 -1
- package/dist/module.js +0 -1584
- package/dist/module.js.map +0 -1
- package/index.js +0 -13
- package/src/Browser.js +0 -297
- package/src/ReactUtils.js +0 -25
- package/src/ScrollPos.js +0 -31
- package/src/isMobileOrTablet.js +0 -28
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import JSZip from "jszip";
|
|
2
|
-
import ObjectExtra from "plugins/utils/ObjectExtra";
|
|
3
|
-
import createDir from "../file/createDir";
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const path = require("path");
|
|
1
|
+
// import JSZip from "jszip";
|
|
2
|
+
// import ObjectExtra from "plugins/utils/ObjectExtra";
|
|
3
|
+
// import createDir from "../file/createDir";
|
|
4
|
+
// const fs = require("fs");
|
|
5
|
+
// const path = require("path");
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const extractZip = async (zipPath, directory, forEach) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
// /**
|
|
8
|
+
// *
|
|
9
|
+
// * @param {string} zipPath
|
|
10
|
+
// * @param {string} directory
|
|
11
|
+
// * @param {Function} forEach
|
|
12
|
+
// */
|
|
13
|
+
// const extractZip = async (zipPath, directory, forEach) => {
|
|
14
|
+
// // let id = -1;
|
|
15
|
+
// // let isCallcb = false;
|
|
16
|
+
// fs.readFile(zipPath, async function (err, data) {
|
|
17
|
+
// if (err) throw err;
|
|
18
|
+
// JSZip.loadAsync(data)
|
|
19
|
+
// .then(async function (zip) {
|
|
20
|
+
// const _length = ObjectExtra.toArray(zip).length;
|
|
21
|
+
// zip.forEach((filePath, fileObj) => {
|
|
22
|
+
// console.log(filePath);
|
|
23
|
+
// var fileName = path.resolve(directory, filePath);
|
|
24
|
+
// if (fileName.indexOf(".DS_Store") >= 0) {
|
|
25
|
+
// return;
|
|
26
|
+
// }
|
|
27
|
+
// if (fileName.indexOf("__MACOSX/") >= 0) {
|
|
28
|
+
// return;
|
|
29
|
+
// }
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
// // console.log(fileName)
|
|
32
|
+
// if (fileObj.dir) {
|
|
33
|
+
// createDir(fileName);
|
|
34
|
+
// if (forEach) forEach(fileName, false);
|
|
35
|
+
// } else {
|
|
36
|
+
// try {
|
|
37
|
+
// fileObj.async("nodebuffer").then((buff) => {
|
|
38
|
+
// fs.writeFileSync(fileName, buff);
|
|
39
|
+
// if (forEach) forEach(fileName, true);
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
41
|
+
// // id++;
|
|
42
|
+
// // if (id >= _length) if (callback && !isCallcb) {
|
|
43
|
+
// // console.log("4")
|
|
44
|
+
// // isCallcb = true;
|
|
45
|
+
// // if (callback) callback();
|
|
46
|
+
// // }
|
|
47
|
+
// });
|
|
48
|
+
// } catch (error) {
|
|
49
|
+
// cosole.log("extractZip ERROR", error);
|
|
50
|
+
// }
|
|
51
|
+
// }
|
|
52
|
+
// });
|
|
53
|
+
// })
|
|
54
|
+
// .then(function () {});
|
|
55
|
+
// });
|
|
56
|
+
// };
|
|
57
57
|
|
|
58
|
-
export default extractZip;
|
|
58
|
+
// export default extractZip;
|