@kezh/my-custom-js-converter 0.0.28 → 0.0.30

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 (2) hide show
  1. package/core/encode.js +6 -1
  2. package/package.json +1 -1
package/core/encode.js CHANGED
@@ -66,6 +66,7 @@ function encoding$0(inPath, outPath) {
66
66
  const customMethodNames = getSrcMethodNames(ENTRY, srcAst);
67
67
  if (!customMethodNames.length) {
68
68
  console.log(`not found entry => ${ENTRY}`);
69
+ return;
69
70
  }
70
71
  const importModPathByName = getImportModPaths(path_1.default.dirname(inPath), srcAst);
71
72
  const importMethodNamesByMod = getImportMethodNames([...importModPathByName.keys()], srcAst);
@@ -94,8 +95,12 @@ function encoding$0(inPath, outPath) {
94
95
  * @returns
95
96
  */
96
97
  function getImportMethods(modPathByName, methodNamesByMod) {
98
+ const importModNames = [...modPathByName.entries()].map(([name]) => name);
99
+ if (!importModNames.length) {
100
+ return [];
101
+ }
102
+ console.log(`import => ${importModNames}`);
97
103
  return [...modPathByName.entries()].flatMap(([name, modPath]) => {
98
- console.log(`import => ${name}`);
99
104
  const mod = fs_1.default.readFileSync(modPath, { encoding: "utf-8" });
100
105
  const modAst = (0, parser_1.parse)(mod);
101
106
  const modMethods = getMethods(name, modAst);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kezh/my-custom-js-converter",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "自定义代码转换器",
5
5
  "main": "index.js",
6
6
  "bin": {