agora-foundation 3.10.1 → 3.10.5
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/lib/utilities/zip.js +6 -6
- package/lib-es/utilities/zip.js +6 -6
- package/package.json +3 -3
package/lib/utilities/zip.js
CHANGED
|
@@ -42,7 +42,7 @@ var COMPRESSION_LEVEL = 9;
|
|
|
42
42
|
var zipDir = exports.zipDir = function zipDir(dirPath, options) {
|
|
43
43
|
return new Promise(/*#__PURE__*/function () {
|
|
44
44
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(resolve) {
|
|
45
|
-
var fs, recursive, files, zip, _iterator, _step, _step$value, relativePath, absolutePath,
|
|
45
|
+
var fs, recursive, files, zip, _iterator, _step, _step$value, relativePath, absolutePath, fileBuffer, blob, buffer, now, datefmt, fileName, file, _t2;
|
|
46
46
|
return _regenerator["default"].wrap(function (_context2) {
|
|
47
47
|
while (1) switch (_context2.prev = _context2.next) {
|
|
48
48
|
case 0:
|
|
@@ -85,8 +85,8 @@ var zipDir = exports.zipDir = function zipDir(dirPath, options) {
|
|
|
85
85
|
try {
|
|
86
86
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
87
87
|
_step$value = _step.value, relativePath = _step$value.relativePath, absolutePath = _step$value.absolutePath;
|
|
88
|
-
|
|
89
|
-
zip.file(relativePath,
|
|
88
|
+
fileBuffer = fs.readFileSync(absolutePath);
|
|
89
|
+
zip.file(relativePath, fileBuffer);
|
|
90
90
|
}
|
|
91
91
|
} catch (err) {
|
|
92
92
|
_iterator.e(err);
|
|
@@ -120,7 +120,7 @@ var zipDir = exports.zipDir = function zipDir(dirPath, options) {
|
|
|
120
120
|
// 原有逻辑:只处理顶层文件
|
|
121
121
|
fs.readdir(dirPath, /*#__PURE__*/function () {
|
|
122
122
|
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(err, files) {
|
|
123
|
-
var zip, _iterator2, _step2, _file, filePath,
|
|
123
|
+
var zip, _iterator2, _step2, _file, filePath, _fileBuffer, blob, buffer, now, datefmt, fileName, file, _t;
|
|
124
124
|
return _regenerator["default"].wrap(function (_context) {
|
|
125
125
|
while (1) switch (_context.prev = _context.next) {
|
|
126
126
|
case 0:
|
|
@@ -169,8 +169,8 @@ var zipDir = exports.zipDir = function zipDir(dirPath, options) {
|
|
|
169
169
|
_context.next = 8;
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
zip.file(_file,
|
|
172
|
+
_fileBuffer = fs.readFileSync(filePath);
|
|
173
|
+
zip.file(_file, _fileBuffer);
|
|
174
174
|
case 8:
|
|
175
175
|
_context.next = 4;
|
|
176
176
|
break;
|
package/lib-es/utilities/zip.js
CHANGED
|
@@ -34,7 +34,7 @@ var COMPRESSION_LEVEL = 9;
|
|
|
34
34
|
export var zipDir = function zipDir(dirPath, options) {
|
|
35
35
|
return new Promise(/*#__PURE__*/function () {
|
|
36
36
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve) {
|
|
37
|
-
var fs, recursive, files, zip, _iterator, _step, _step$value, relativePath, absolutePath,
|
|
37
|
+
var fs, recursive, files, zip, _iterator, _step, _step$value, relativePath, absolutePath, fileBuffer, blob, buffer, now, datefmt, fileName, file, _t2;
|
|
38
38
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
39
39
|
while (1) switch (_context2.prev = _context2.next) {
|
|
40
40
|
case 0:
|
|
@@ -77,8 +77,8 @@ export var zipDir = function zipDir(dirPath, options) {
|
|
|
77
77
|
try {
|
|
78
78
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
79
79
|
_step$value = _step.value, relativePath = _step$value.relativePath, absolutePath = _step$value.absolutePath;
|
|
80
|
-
|
|
81
|
-
zip.file(relativePath,
|
|
80
|
+
fileBuffer = fs.readFileSync(absolutePath);
|
|
81
|
+
zip.file(relativePath, fileBuffer);
|
|
82
82
|
}
|
|
83
83
|
} catch (err) {
|
|
84
84
|
_iterator.e(err);
|
|
@@ -112,7 +112,7 @@ export var zipDir = function zipDir(dirPath, options) {
|
|
|
112
112
|
// 原有逻辑:只处理顶层文件
|
|
113
113
|
fs.readdir(dirPath, /*#__PURE__*/function () {
|
|
114
114
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(err, files) {
|
|
115
|
-
var zip, _iterator2, _step2, _file, filePath,
|
|
115
|
+
var zip, _iterator2, _step2, _file, filePath, _fileBuffer, blob, buffer, now, datefmt, fileName, file, _t;
|
|
116
116
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
117
117
|
while (1) switch (_context.prev = _context.next) {
|
|
118
118
|
case 0:
|
|
@@ -161,8 +161,8 @@ export var zipDir = function zipDir(dirPath, options) {
|
|
|
161
161
|
_context.next = 8;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
zip.file(_file,
|
|
164
|
+
_fileBuffer = fs.readFileSync(filePath);
|
|
165
|
+
zip.file(_file, _fileBuffer);
|
|
166
166
|
case 8:
|
|
167
167
|
_context.next = 4;
|
|
168
168
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agora-foundation",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/jasmine": "^5.1.4",
|
|
25
25
|
"@types/lodash": "^4.14.168",
|
|
26
26
|
"@types/node": "^20.11.30",
|
|
27
|
-
"agora-toolchain": "3.10.
|
|
27
|
+
"agora-toolchain": "3.10.5",
|
|
28
28
|
"core-js": "^3.33.3",
|
|
29
29
|
"tslib": "^2.6.2",
|
|
30
30
|
"winston": "^3.16.0",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"dexie": "^3.0.3",
|
|
37
37
|
"jszip": "^3.10.1",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
39
|
-
"zod": "
|
|
39
|
+
"zod": "3.24.2"
|
|
40
40
|
}
|
|
41
41
|
}
|