@eslint-react/var 1.22.2-next.6 → 1.22.2-next.8

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/dist/index.js CHANGED
@@ -108,18 +108,12 @@ function inspectConstruction(node, initialScope, hint = ConstructionHint.None) {
108
108
  return Construction.RegExpLiteral({ node: node3, usage: eff.O.none() });
109
109
  }
110
110
  return Construction.None();
111
- }).when(
112
- AST__namespace.isOneOf([
113
- types.AST_NODE_TYPES.TSAsExpression,
114
- types.AST_NODE_TYPES.TSTypeAssertion
115
- ]),
116
- () => {
117
- if (!("expression" in node2) || !eff.isObject(node2.expression)) {
118
- return Construction.None();
119
- }
120
- return detect(node2.expression);
111
+ }).when(AST__namespace.isTypeExpression, () => {
112
+ if (!("expression" in node2) || !eff.isObject(node2.expression)) {
113
+ return Construction.None();
121
114
  }
122
- ).otherwise(() => Construction.None());
115
+ return detect(node2.expression);
116
+ }).otherwise(() => Construction.None());
123
117
  };
124
118
  return detect(node);
125
119
  }
@@ -232,6 +226,9 @@ var thisBlockTypes = [
232
226
  function isNodeValueEqual(a, b, initialScopes) {
233
227
  const [aScope, bScope] = initialScopes;
234
228
  switch (true) {
229
+ case a === b: {
230
+ return true;
231
+ }
235
232
  case (a.type === types.AST_NODE_TYPES.Literal && b.type === types.AST_NODE_TYPES.Literal): {
236
233
  return a.value === b.value;
237
234
  }
package/dist/index.mjs CHANGED
@@ -85,18 +85,12 @@ function inspectConstruction(node, initialScope, hint = ConstructionHint.None) {
85
85
  return Construction.RegExpLiteral({ node: node3, usage: O.none() });
86
86
  }
87
87
  return Construction.None();
88
- }).when(
89
- AST.isOneOf([
90
- AST_NODE_TYPES.TSAsExpression,
91
- AST_NODE_TYPES.TSTypeAssertion
92
- ]),
93
- () => {
94
- if (!("expression" in node2) || !isObject(node2.expression)) {
95
- return Construction.None();
96
- }
97
- return detect(node2.expression);
88
+ }).when(AST.isTypeExpression, () => {
89
+ if (!("expression" in node2) || !isObject(node2.expression)) {
90
+ return Construction.None();
98
91
  }
99
- ).otherwise(() => Construction.None());
92
+ return detect(node2.expression);
93
+ }).otherwise(() => Construction.None());
100
94
  };
101
95
  return detect(node);
102
96
  }
@@ -209,6 +203,9 @@ var thisBlockTypes = [
209
203
  function isNodeValueEqual(a, b, initialScopes) {
210
204
  const [aScope, bScope] = initialScopes;
211
205
  switch (true) {
206
+ case a === b: {
207
+ return true;
208
+ }
212
209
  case (a.type === AST_NODE_TYPES.Literal && b.type === AST_NODE_TYPES.Literal): {
213
210
  return a.value === b.value;
214
211
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/var",
3
- "version": "1.22.2-next.6",
3
+ "version": "1.22.2-next.8",
4
4
  "description": "ESLint React's TSESTree AST utility module for static analysis of variables",
5
5
  "homepage": "https://github.com/rEl1cx/eslint-react",
6
6
  "bugs": {
@@ -38,9 +38,9 @@
38
38
  "@typescript-eslint/utils": "^8.18.2",
39
39
  "string-ts": "^2.2.0",
40
40
  "ts-pattern": "^5.6.0",
41
- "@eslint-react/ast": "1.22.2-next.6",
42
- "@eslint-react/types": "1.22.2-next.6",
43
- "@eslint-react/eff": "1.22.2-next.6"
41
+ "@eslint-react/ast": "1.22.2-next.8",
42
+ "@eslint-react/eff": "1.22.2-next.8",
43
+ "@eslint-react/types": "1.22.2-next.8"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.3.5",