fast-cocos 1.1.20 → 1.1.22

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.
@@ -94,7 +94,7 @@ class Audio {
94
94
  // 旧版本模式
95
95
  return {
96
96
  fileName,
97
- ref: `${options.bundle}://${xlsxName}/audio/{0}/`,
97
+ ref: `${options.bundle}://${xlsxName}/audio/`,
98
98
  output: path_1.default.join(options.output, xlsxName, "audio"),
99
99
  script: path_1.default.join(options.script, xlsxName, "config", `${fileName}.ts`),
100
100
  };
@@ -17,8 +17,8 @@ const JsonUtils_1 = require("./JsonUtils");
17
17
  function main() {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  commander_1.program
20
- .name("merge-json")
21
- .description("merge json utility")
20
+ .name("json")
21
+ .description("json utility")
22
22
  .version("1.0.0")
23
23
  .requiredOption("-s, --source <source>", "source directory")
24
24
  .requiredOption("-o, --output <output>", "output directory")
package/dist/utils.js CHANGED
@@ -164,7 +164,7 @@ var utils;
164
164
  fs_1.default.mkdirSync(dir, { recursive: true });
165
165
  }
166
166
  if (typeof content != "string") {
167
- content = JSON.stringify(content, null, 4);
167
+ content = JSON.stringify(content);
168
168
  }
169
169
  fs_1.default.writeFileSync(filePath, content, { encoding: "utf-8" });
170
170
  }
@@ -228,11 +228,11 @@ var utils;
228
228
  }
229
229
  utils.rmSync = rmSync;
230
230
  /**
231
- * 字符串格式化
232
- * @param template
233
- * @param args
234
- * @example let str = "my name is {0}, my age is {1}", stringFormat(str,"test",30) => my name is test, my age is 30
235
- * */
231
+ * 字符串格式化
232
+ * @param template
233
+ * @param args
234
+ * @example let str = "my name is {0}, my age is {1}", stringFormat(str,"test",30) => my name is test, my age is 30
235
+ * */
236
236
  function stringFormat(template, ...args) {
237
237
  if (!template) {
238
238
  return "";
@@ -246,10 +246,20 @@ var utils;
246
246
  return template;
247
247
  }
248
248
  utils.stringFormat = stringFormat;
249
+ /**
250
+ * Base64 解码为字符串
251
+ * @param base64 Base64 字符串
252
+ * @returns 解码后的 utf-8 字符串
253
+ */
249
254
  function decodeBase64(base64) {
250
255
  return Buffer.from(base64, "base64").toString("utf-8");
251
256
  }
252
257
  utils.decodeBase64 = decodeBase64;
258
+ /**
259
+ * 字符串编码为 Base64
260
+ * @param str 原始字符串
261
+ * @returns Base64 字符串
262
+ */
253
263
  function encodeBase64(str) {
254
264
  return Buffer.from(str).toString("base64");
255
265
  }
@@ -672,7 +672,7 @@ class XlsxParser {
672
672
  }
673
673
  propertyStr += `\n`;
674
674
  propertyStr += " ".repeat(4) + `/** ${annotation} */\n`;
675
- propertyStr += " ".repeat(4) + `public readonly ${filename}: sheet.${filename};\n`;
675
+ propertyStr += " ".repeat(4) + `public readonly ${filename}: sheet.${filename} = null!;\n`;
676
676
  assignStr += " ".repeat(8) + `(this.${filename} as any) = "${filename}";\n`;
677
677
  }
678
678
  scriptStr = scriptStr.replace("{0}", propertyStr);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-cocos",
3
- "version": "1.1.20",
3
+ "version": "1.1.22",
4
4
  "scripts": {
5
5
  "clean": "rm -rf dist",
6
6
  "start": "node ./dist/index.js",