New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@typescript-eslint/type-utils

Package Overview
Dependencies
Maintainers
2
Versions
2365
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typescript-eslint/type-utils - npm Package Compare versions

Comparing version 8.21.1-alpha.3 to 8.21.1-alpha.4

48

dist/TypeOrValueSpecifier.js

@@ -138,22 +138,34 @@ "use strict";

function typeMatchesSpecifier(type, specifier, program) {
if (tsutils.isIntrinsicErrorType(type)) {
return false;
const wholeTypeMatches = (() => {
if (tsutils.isIntrinsicErrorType(type)) {
return false;
}
if (typeof specifier === 'string') {
return (0, specifierNameMatches_1.specifierNameMatches)(type, specifier);
}
if (!(0, specifierNameMatches_1.specifierNameMatches)(type, specifier.name)) {
return false;
}
const symbol = type.getSymbol() ?? type.aliasSymbol;
const declarations = symbol?.getDeclarations() ?? [];
const declarationFiles = declarations.map(declaration => declaration.getSourceFile());
switch (specifier.from) {
case 'file':
return (0, typeDeclaredInFile_1.typeDeclaredInFile)(specifier.path, declarationFiles, program);
case 'lib':
return (0, typeDeclaredInLib_1.typeDeclaredInLib)(declarationFiles, program);
case 'package':
return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program);
}
})();
if (wholeTypeMatches) {
return true;
}
if (typeof specifier === 'string') {
return (0, specifierNameMatches_1.specifierNameMatches)(type, specifier);
if (tsutils.isIntersectionType(type) &&
tsutils
.intersectionTypeParts(type)
.some(part => typeMatchesSpecifier(part, specifier, program))) {
return true;
}
if (!(0, specifierNameMatches_1.specifierNameMatches)(type, specifier.name)) {
return false;
}
const symbol = type.getSymbol() ?? type.aliasSymbol;
const declarations = symbol?.getDeclarations() ?? [];
const declarationFiles = declarations.map(declaration => declaration.getSourceFile());
switch (specifier.from) {
case 'file':
return (0, typeDeclaredInFile_1.typeDeclaredInFile)(specifier.path, declarationFiles, program);
case 'lib':
return (0, typeDeclaredInLib_1.typeDeclaredInLib)(declarationFiles, program);
case 'package':
return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program);
}
return false;
}

@@ -160,0 +172,0 @@ const typeMatchesSomeSpecifier = (type, specifiers = [], program) => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program));

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.specifierNameMatches = specifierNameMatches;
const tsutils = __importStar(require("ts-api-utils"));
function specifierNameMatches(type, names) {

@@ -49,7 +15,4 @@ if (typeof names === 'string') {

}
if (tsutils.isIntersectionType(type)) {
return type.types.some(subType => specifierNameMatches(subType, names));
}
return false;
}
//# sourceMappingURL=specifierNameMatches.js.map
{
"name": "@typescript-eslint/type-utils",
"version": "8.21.1-alpha.3",
"version": "8.21.1-alpha.4",
"description": "Type utilities for working with TypeScript + ESLint together",

@@ -49,4 +49,4 @@ "files": [

"dependencies": {
"@typescript-eslint/typescript-estree": "8.21.1-alpha.3",
"@typescript-eslint/utils": "8.21.1-alpha.3",
"@typescript-eslint/typescript-estree": "8.21.1-alpha.4",
"@typescript-eslint/utils": "8.21.1-alpha.4",
"debug": "^4.3.4",

@@ -61,3 +61,3 @@ "ts-api-utils": "^2.0.0"

"@jest/types": "29.6.3",
"@typescript-eslint/parser": "8.21.1-alpha.3",
"@typescript-eslint/parser": "8.21.1-alpha.4",
"ajv": "^6.12.6",

@@ -64,0 +64,0 @@ "downlevel-dts": "*",

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc