@kezh/my-custom-js-converter 1.1.3 → 1.1.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.
@@ -153,16 +153,25 @@ class MapContext {
153
153
  const inlineMethods = (0, ast_1.getInlineMethodsByMethodName)(astMap.get(method[0]), method[0], method[1], useMethodNameMap);
154
154
  readyStack.push(...inlineMethods.map((m) => m.split("#")));
155
155
  }
156
- [...filterMethodMap.keys()].forEach((fMod) => {
157
- const filterMethods = filterMethodMap.get(fMod);
158
- this.getModNames().forEach((modName) => {
159
- var _a;
160
- const dep = (_a = this.getMod(modName)) === null || _a === void 0 ? void 0 : _a.dependencies[fMod];
161
- if (dep) {
162
- dep.methods = dep.methods.filter((m) => filterMethods.has(m));
163
- }
164
- });
156
+ const filterMapConfig = new map_config_1.MapConfig();
157
+ this.getModNames()
158
+ .map((modName) => [modName, this.getMod(modName)])
159
+ .filter((modInfo) => modInfo[1])
160
+ .forEach((modInfo) => {
161
+ const filterDeps = new map_config_1.Dependencies();
162
+ const mod = modInfo[1];
163
+ const deps = mod.dependencies;
164
+ Object.keys(deps)
165
+ .filter((depName) => [...filterMethodMap.keys()].includes(depName))
166
+ .map((depName) => {
167
+ const filterMethods = deps[depName].methods.filter((method) => filterMethodMap.get(depName).has(method));
168
+ return [depName, new map_config_1.Dependency(filterMethods)];
169
+ })
170
+ .forEach((depInfo) => (filterDeps[depInfo[0]] = depInfo[1]));
171
+ const filterMod = new map_config_1.Mod(mod === null || mod === void 0 ? void 0 : mod.src, filterDeps);
172
+ filterMapConfig[modInfo[0]] = filterMod;
165
173
  });
174
+ this.map = filterMapConfig;
166
175
  }
167
176
  }
168
177
  exports.MapContext = MapContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kezh/my-custom-js-converter",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "自定义代码转换器",
5
5
  "main": "index.js",
6
6
  "bin": {