@weapp-vite/ast 6.16.5 → 6.16.6

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.
@@ -21,8 +21,11 @@ const CONSTRUCTOR_TYPE_MAP = {
21
21
  Null: "any",
22
22
  NullConstructor: "any"
23
23
  };
24
+ function hasOwn(source, key) {
25
+ return Object.prototype.hasOwnProperty.call(source, key);
26
+ }
24
27
  function mapConstructorName(name) {
25
- if (Object.hasOwn(CONSTRUCTOR_TYPE_MAP, name)) return CONSTRUCTOR_TYPE_MAP[name];
28
+ if (hasOwn(CONSTRUCTOR_TYPE_MAP, name)) return CONSTRUCTOR_TYPE_MAP[name];
26
29
  return CONSTRUCTOR_TYPE_MAP[name.endsWith("Constructor") ? name.slice(0, -11) : name] ?? "any";
27
30
  }
28
31
  function resolveTypeFromNode(node) {
@@ -163,7 +163,7 @@ function collectIdentifiersFromExpressionWithOxc(expression) {
163
163
  case "VariableDeclarator": {
164
164
  const bindings = /* @__PURE__ */ new Set();
165
165
  collectPatternBindingNames(node.id, bindings);
166
- const currentScope = scopes.at(-1);
166
+ const currentScope = scopes[scopes.length - 1];
167
167
  for (const binding of bindings) currentScope?.add(binding);
168
168
  visit(node.init);
169
169
  return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/ast",
3
3
  "type": "module",
4
- "version": "6.16.5",
4
+ "version": "6.16.6",
5
5
  "description": "weapp-vite 共享 AST 分析工具包,统一 Babel/Oxc 解析与常用分析操作",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",