@kezh/my-custom-js-converter 0.1.57 → 0.1.59

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/util/ast.js +7 -1
  2. package/package.json +1 -1
package/core/util/ast.js CHANGED
@@ -332,6 +332,9 @@ function deleteModMethods(srcAst, mapContext) {
332
332
  }
333
333
  const methodName = path.node.key.name;
334
334
  const split = methodName.split("__");
335
+ if (split.length < 2) {
336
+ return;
337
+ }
335
338
  const depName = split.length ? split[split.length - 1] : "";
336
339
  deps.has(depName) && path.remove();
337
340
  }
@@ -343,7 +346,10 @@ function deleteModMethods(srcAst, mapContext) {
343
346
  }
344
347
  const methodName = path.node.property.name;
345
348
  const split = methodName.split("__");
346
- const depName = split.length ? split[split.length - 1] : "";
349
+ if (split.length < 2) {
350
+ return;
351
+ }
352
+ const depName = split[split.length - 1];
347
353
  if (deps.has(depName)) {
348
354
  path.node.property.name = methodName.replace(`__${depName}`, "");
349
355
  if (core_1.types.isThisExpression(path.node.object)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kezh/my-custom-js-converter",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "description": "自定义代码转换器",
5
5
  "main": "index.js",
6
6
  "bin": {