@typescript-eslint/type-utils
Advanced tools
Comparing version 5.13.1-alpha.3 to 5.13.1-alpha.4
@@ -113,2 +113,6 @@ "use strict"; | ||
} | ||
const name = ts.getNameOfDeclaration(property.valueDeclaration); | ||
if (name && ts.isPrivateIdentifier(name)) { | ||
continue; | ||
} | ||
return 2 /* Mutable */; | ||
@@ -115,0 +119,0 @@ } |
@@ -6,3 +6,3 @@ "use strict"; | ||
// Most names are directly usable in the checker and aren't different from escaped names | ||
if (!escapedName || !name.startsWith('__')) { | ||
if (!escapedName || !isSymbol(escapedName)) { | ||
return checker.getTypeOfPropertyOfType(type, name); | ||
@@ -24,2 +24,16 @@ } | ||
exports.getTypeOfPropertyOfType = getTypeOfPropertyOfType; | ||
// Symbolic names need to be specially handled because TS api is not sufficient for these cases. | ||
// Source based on: | ||
// https://github.com/microsoft/TypeScript/blob/0043abe982aae0d35f8df59f9715be6ada758ff7/src/compiler/utilities.ts#L3388-L3402 | ||
function isSymbol(escapedName) { | ||
return isKnownSymbol(escapedName) || isPrivateIdentifierSymbol(escapedName); | ||
} | ||
// case for escapedName: "__@foo@10", name: "__@foo@10" | ||
function isKnownSymbol(escapedName) { | ||
return escapedName.startsWith('__@'); | ||
} | ||
// case for escapedName: "__#1@#foo", name: "#foo" | ||
function isPrivateIdentifierSymbol(escapedName) { | ||
return escapedName.startsWith('__#'); | ||
} | ||
//# sourceMappingURL=propertyTypes.js.map |
{ | ||
"name": "@typescript-eslint/type-utils", | ||
"version": "5.13.1-alpha.3+6c0a777d", | ||
"version": "5.13.1-alpha.4+a65713ae", | ||
"description": "Type utilities for working with TypeScript + ESLint together", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@typescript-eslint/utils": "5.13.1-alpha.3+6c0a777d", | ||
"@typescript-eslint/utils": "5.13.1-alpha.4+a65713ae", | ||
"debug": "^4.3.2", | ||
@@ -48,3 +48,3 @@ "tsutils": "^3.21.0" | ||
"devDependencies": { | ||
"@typescript-eslint/parser": "5.13.1-alpha.3+6c0a777d", | ||
"@typescript-eslint/parser": "5.13.1-alpha.4+a65713ae", | ||
"typescript": "*" | ||
@@ -71,3 +71,3 @@ }, | ||
}, | ||
"gitHead": "6c0a777de4d5ed7a777814c7032485149291cb73" | ||
"gitHead": "a65713ae138e56555d01a9e8e5179221a2f39e75" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
75680
1059