esoftplay 0.0.119-d → 0.0.119-e
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/bin/router.js +13 -10
- package/package.json +1 -1
package/bin/router.js
CHANGED
|
@@ -239,7 +239,7 @@ checks.forEach(modules => {
|
|
|
239
239
|
tmpTask[clsName]["class"] = m[1].replace(m[2], clsName).trim();
|
|
240
240
|
|
|
241
241
|
/* tambahkan fungsi Crypt */
|
|
242
|
-
if (clsName
|
|
242
|
+
if (clsName === 'LibCrypt') {
|
|
243
243
|
tmpTask[clsName]["function"]['encode'] = 'encode(text: string): string;';
|
|
244
244
|
tmpTask[clsName]["function"]['decode'] = 'decode(text: string): string;';
|
|
245
245
|
}
|
|
@@ -461,22 +461,26 @@ declare module "esoftplay" {
|
|
|
461
461
|
function createCache<S>(initialCache?: S, option?: createCacheOption): createCacheReturn<S>;`;
|
|
462
462
|
for (clsName in tmpTask) {
|
|
463
463
|
let ItemText = ""
|
|
464
|
-
|
|
464
|
+
if (clsName === 'LibCrypt') {
|
|
465
|
+
tmpTask[clsName]["class"] = "class LibCrypt"
|
|
466
|
+
tmpTask[clsName]["function"]['encode'] = 'encode(text: string): string;';
|
|
467
|
+
tmpTask[clsName]["function"]['decode'] = 'decode(text: string): string;';
|
|
468
|
+
}
|
|
465
469
|
if (tmpTask[clsName]["class"]) {
|
|
466
470
|
// ItemText += "\n";
|
|
467
471
|
for (var i = 0; i < tmpTask[clsName]["type"].length; i++) {
|
|
468
|
-
ItemText += "\n
|
|
472
|
+
ItemText += "\n " + tmpTask[clsName]["type"][i].replace(/\n/g, "\n ");
|
|
469
473
|
}
|
|
470
474
|
for (var i = 0; i < tmpTask[clsName]["interface"].length; i++) {
|
|
471
|
-
ItemText += "\n
|
|
475
|
+
ItemText += "\n " + tmpTask[clsName]["interface"][i].replace(/\n/g, "\n ");
|
|
472
476
|
}
|
|
473
477
|
ItemText += "\n export " + tmpTask[clsName]["class"] + " {";
|
|
474
478
|
var isFilled = false;
|
|
475
479
|
for (fun in tmpTask[clsName]["var"]) {
|
|
476
|
-
ItemText += "\n
|
|
480
|
+
ItemText += "\n " + tmpTask[clsName]["var"][fun];
|
|
477
481
|
}
|
|
478
482
|
for (fun in tmpTask[clsName]["function"]) {
|
|
479
|
-
ItemText += "\n
|
|
483
|
+
ItemText += "\n " + tmpTask[clsName]["function"][fun];
|
|
480
484
|
isFilled = true;
|
|
481
485
|
}
|
|
482
486
|
if (isFilled) {
|
|
@@ -528,10 +532,9 @@ declare module "esoftplay" {
|
|
|
528
532
|
ItemText += "}";
|
|
529
533
|
}
|
|
530
534
|
const [module, task] = clsName.split(/(?=[A-Z])/)
|
|
531
|
-
const nav = module
|
|
532
|
-
// console.log(tmpTask)
|
|
535
|
+
const nav = module?.toLowerCase() + '/' + task?.toLowerCase()
|
|
533
536
|
try {
|
|
534
|
-
fs.mkdirSync(tmpDir + module
|
|
537
|
+
fs.mkdirSync(tmpDir + module?.toLowerCase())
|
|
535
538
|
} catch (error) { }
|
|
536
539
|
PreText += "import '" + tmpDir + nav + ".import.d';\n"
|
|
537
540
|
fs.writeFile(tmpDir + nav + '.import.d.ts', ItemText, { flag: 'w' }, function (err) {
|
|
@@ -598,7 +601,7 @@ function createRouter() {
|
|
|
598
601
|
var nav = "";
|
|
599
602
|
var staticImport = []
|
|
600
603
|
|
|
601
|
-
staticImport.push("var isEqual = require('react-fast-compare');\n")
|
|
604
|
+
// staticImport.push("var isEqual = require('react-fast-compare');\n")
|
|
602
605
|
staticImport.push("export function applyStyle(style){ return style };\n")
|
|
603
606
|
staticImport.push("export { default as useGlobalState } from '../../../node_modules/esoftplay/global';\n")
|
|
604
607
|
staticImport.push("export { default as usePersistState } from '../../../node_modules/esoftplay/persist';\n")
|