@typescript-eslint/type-utils 8.0.0-alpha.56 → 8.0.0-alpha.57
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
export declare function specifierNameMatches(type: ts.Type,
|
|
2
|
+
export declare function specifierNameMatches(type: ts.Type, names: string[] | string): boolean;
|
|
3
3
|
//# sourceMappingURL=specifierNameMatches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specifierNameMatches.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/specifierNameMatches.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"specifierNameMatches.d.ts","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/specifierNameMatches.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,GACvB,OAAO,CAmBT"}
|
|
@@ -1,17 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.specifierNameMatches = specifierNameMatches;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
27
|
+
const tsutils = __importStar(require("ts-api-utils"));
|
|
28
|
+
function specifierNameMatches(type, names) {
|
|
29
|
+
if (typeof names === 'string') {
|
|
30
|
+
names = [names];
|
|
7
31
|
}
|
|
8
|
-
|
|
32
|
+
const symbol = type.aliasSymbol ?? type.getSymbol();
|
|
33
|
+
const candidateNames = symbol
|
|
34
|
+
? [symbol.escapedName, type.intrinsicName]
|
|
35
|
+
: [type.intrinsicName];
|
|
36
|
+
if (names.some(item => candidateNames.includes(item))) {
|
|
9
37
|
return true;
|
|
10
38
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return false;
|
|
39
|
+
if (tsutils.isIntersectionType(type)) {
|
|
40
|
+
return type.types.some(subType => specifierNameMatches(subType, names));
|
|
14
41
|
}
|
|
15
|
-
return
|
|
42
|
+
return false;
|
|
16
43
|
}
|
|
17
44
|
//# sourceMappingURL=specifierNameMatches.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specifierNameMatches.js","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/specifierNameMatches.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"specifierNameMatches.js","sourceRoot":"","sources":["../../src/typeOrValueSpecifiers/specifierNameMatches.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,oDAsBC;AAzBD,sDAAwC;AAGxC,SAAgB,oBAAoB,CAClC,IAAa,EACb,KAAwB;IAExB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;IACpD,MAAM,cAAc,GAAG,MAAM;QAC3B,CAAC,CAAC,CAAC,MAAM,CAAC,WAAqB,EAAE,IAAI,CAAC,aAAa,CAAC;QACpD,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAEzB,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/type-utils",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.57",
|
|
4
4
|
"description": "Type utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"typecheck": "tsc --noEmit"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@typescript-eslint/typescript-estree": "8.0.0-alpha.
|
|
50
|
-
"@typescript-eslint/utils": "8.0.0-alpha.
|
|
49
|
+
"@typescript-eslint/typescript-estree": "8.0.0-alpha.57",
|
|
50
|
+
"@typescript-eslint/utils": "8.0.0-alpha.57",
|
|
51
51
|
"debug": "^4.3.4",
|
|
52
52
|
"ts-api-utils": "^1.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@jest/types": "29.6.3",
|
|
56
|
-
"@typescript-eslint/parser": "8.0.0-alpha.
|
|
56
|
+
"@typescript-eslint/parser": "8.0.0-alpha.57",
|
|
57
57
|
"ajv": "^6.12.6",
|
|
58
58
|
"downlevel-dts": "*",
|
|
59
59
|
"jest": "29.7.0",
|