Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2023-12-13 11:12:49 +00:00
parent dcf89a7576
commit 0d8f348775
31 changed files with 802 additions and 666 deletions

48
node_modules/typescript/lib/tsc.js generated vendored
View file

@ -18,7 +18,7 @@ and limitations under the License.
// src/compiler/corePublic.ts
var versionMajorMinor = "5.3";
var version = "5.3.2";
var version = "5.3.3";
// src/compiler/core.ts
var emptyArray = [];
@ -3678,7 +3678,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
@ -15971,7 +15971,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
}
function getObjectFlags(type) {
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
}
function isUMDExportSymbol(symbol) {
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
@ -56944,7 +56944,7 @@ function createTypeChecker(host) {
}
}
function removeStringLiteralsMatchedByTemplateLiterals(types) {
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
if (templates.length) {
let i = types.length;
while (i > 0) {
@ -57344,19 +57344,14 @@ function createTypeChecker(host) {
function getConstituentCountOfTypes(types) {
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
}
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
if (types.length !== 2) {
return false;
}
const [t1, t2] = types;
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
}
function getTypeFromIntersectionTypeNode(node) {
const links = getNodeLinks(node);
if (!links.resolvedType) {
const aliasSymbol = getAliasSymbolForTypeNode(node);
const types = map(node.types, getTypeFromTypeNode);
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
}
return links.resolvedType;
@ -57568,11 +57563,6 @@ function createTypeChecker(host) {
}
function createTemplateLiteralType(texts, types) {
const type = createType(134217728 /* TemplateLiteral */);
type.objectFlags = getPropagatingFlagsOfTypes(
types,
/*excludeKinds*/
98304 /* Nullable */
);
type.texts = texts;
type.types = types;
return type;
@ -57867,7 +57857,15 @@ function createTypeChecker(host) {
}
function isPatternLiteralPlaceholderType(type) {
if (type.flags & 2097152 /* Intersection */) {
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
let seenPlaceholder = false;
for (const t of type.types) {
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
seenPlaceholder = true;
} else if (!(t.flags & 524288 /* Object */)) {
return false;
}
}
return seenPlaceholder;
}
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
}
@ -57884,7 +57882,7 @@ function createTypeChecker(host) {
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
}
function getGenericObjectFlags(type) {
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
if (type.flags & 3145728 /* UnionOrIntersection */) {
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
}
@ -57896,7 +57894,7 @@ function createTypeChecker(host) {
}
return type.objectFlags & 12582912 /* IsGenericType */;
}
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
}
function getSimplifiedType(type, writing) {
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
@ -58922,7 +58920,7 @@ function createTypeChecker(host) {
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
target.instantiations.set(id, result);
const resultObjectFlags = getObjectFlags(result);
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
@ -63636,8 +63634,8 @@ function createTypeChecker(host) {
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
}
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 138117121 /* ObjectFlagsType */) {
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 3899393 /* ObjectFlagsType */) {
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
}
return result;
@ -66155,10 +66153,10 @@ function createTypeChecker(host) {
if (isMatchingConstructorReference(right)) {
return narrowTypeByConstructor(type, operator, left, assumeTrue);
}
if (isBooleanLiteral(right)) {
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
}
if (isBooleanLiteral(left)) {
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
}
break;

View file

@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
// src/compiler/corePublic.ts
var versionMajorMinor = "5.3";
var version = "5.3.2";
var version = "5.3.3";
var Comparison = /* @__PURE__ */ ((Comparison3) => {
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@ -6670,7 +6670,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
@ -20036,7 +20036,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
}
function getObjectFlags(type) {
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
}
function forSomeAncestorDirectory(directory, callback) {
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
@ -61648,7 +61648,7 @@ function createTypeChecker(host) {
}
}
function removeStringLiteralsMatchedByTemplateLiterals(types) {
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
if (templates.length) {
let i = types.length;
while (i > 0) {
@ -62048,19 +62048,14 @@ function createTypeChecker(host) {
function getConstituentCountOfTypes(types) {
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
}
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
if (types.length !== 2) {
return false;
}
const [t1, t2] = types;
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
}
function getTypeFromIntersectionTypeNode(node) {
const links = getNodeLinks(node);
if (!links.resolvedType) {
const aliasSymbol = getAliasSymbolForTypeNode(node);
const types = map(node.types, getTypeFromTypeNode);
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
}
return links.resolvedType;
@ -62272,11 +62267,6 @@ function createTypeChecker(host) {
}
function createTemplateLiteralType(texts, types) {
const type = createType(134217728 /* TemplateLiteral */);
type.objectFlags = getPropagatingFlagsOfTypes(
types,
/*excludeKinds*/
98304 /* Nullable */
);
type.texts = texts;
type.types = types;
return type;
@ -62571,7 +62561,15 @@ function createTypeChecker(host) {
}
function isPatternLiteralPlaceholderType(type) {
if (type.flags & 2097152 /* Intersection */) {
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
let seenPlaceholder = false;
for (const t of type.types) {
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
seenPlaceholder = true;
} else if (!(t.flags & 524288 /* Object */)) {
return false;
}
}
return seenPlaceholder;
}
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
}
@ -62588,7 +62586,7 @@ function createTypeChecker(host) {
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
}
function getGenericObjectFlags(type) {
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
if (type.flags & 3145728 /* UnionOrIntersection */) {
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
}
@ -62600,7 +62598,7 @@ function createTypeChecker(host) {
}
return type.objectFlags & 12582912 /* IsGenericType */;
}
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
}
function getSimplifiedType(type, writing) {
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
@ -63626,7 +63624,7 @@ function createTypeChecker(host) {
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
target.instantiations.set(id, result);
const resultObjectFlags = getObjectFlags(result);
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
@ -68340,8 +68338,8 @@ function createTypeChecker(host) {
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
}
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 138117121 /* ObjectFlagsType */) {
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 3899393 /* ObjectFlagsType */) {
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
}
return result;
@ -70859,10 +70857,10 @@ function createTypeChecker(host) {
if (isMatchingConstructorReference(right)) {
return narrowTypeByConstructor(type, operator, left, assumeTrue);
}
if (isBooleanLiteral(right)) {
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
}
if (isBooleanLiteral(left)) {
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
}
break;
@ -137311,7 +137309,7 @@ function transpileModule(input, transpileOptions) {
options
),
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
jsDocParsingMode: 1 /* ParseNone */
jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */
}
);
if (transpileOptions.moduleName) {

View file

@ -6018,9 +6018,11 @@ declare namespace ts {
/** @deprecated */
type AssertionKey = ImportAttributeName;
/** @deprecated */
type AssertEntry = ImportAttribute;
interface AssertEntry extends ImportAttribute {
}
/** @deprecated */
type AssertClause = ImportAttributes;
interface AssertClause extends ImportAttributes {
}
type ImportAttributeName = Identifier | StringLiteral;
interface ImportAttribute extends Node {
readonly kind: SyntaxKind.ImportAttribute;
@ -10416,7 +10418,7 @@ declare namespace ts {
installPackage?(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
writeFile?(fileName: string, content: string): void;
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
jsDocParsingMode?: JSDocParsingMode;
jsDocParsingMode?: JSDocParsingMode | undefined;
}
type WithMetadata<T> = T & {
metadata?: unknown;
@ -11612,6 +11614,7 @@ declare namespace ts {
moduleName?: string;
renamedDependencies?: MapLike<string>;
transformers?: CustomTransformers;
jsDocParsingMode?: JSDocParsingMode;
}
interface TranspileOutput {
outputText: string;

View file

@ -35,7 +35,7 @@ var ts = (() => {
"src/compiler/corePublic.ts"() {
"use strict";
versionMajorMinor = "5.3";
version = "5.3.2";
version = "5.3.3";
Comparison = /* @__PURE__ */ ((Comparison3) => {
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@ -4435,7 +4435,7 @@ ${lanes.join("\n")}
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
@ -17337,7 +17337,7 @@ ${lanes.join("\n")}
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
}
function getObjectFlags(type) {
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
}
function forSomeAncestorDirectory(directory, callback) {
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
@ -59415,7 +59415,7 @@ ${lanes.join("\n")}
}
}
function removeStringLiteralsMatchedByTemplateLiterals(types) {
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
if (templates.length) {
let i = types.length;
while (i > 0) {
@ -59815,19 +59815,14 @@ ${lanes.join("\n")}
function getConstituentCountOfTypes(types) {
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
}
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
if (types.length !== 2) {
return false;
}
const [t1, t2] = types;
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
}
function getTypeFromIntersectionTypeNode(node) {
const links = getNodeLinks(node);
if (!links.resolvedType) {
const aliasSymbol = getAliasSymbolForTypeNode(node);
const types = map(node.types, getTypeFromTypeNode);
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
}
return links.resolvedType;
@ -60039,11 +60034,6 @@ ${lanes.join("\n")}
}
function createTemplateLiteralType(texts, types) {
const type = createType(134217728 /* TemplateLiteral */);
type.objectFlags = getPropagatingFlagsOfTypes(
types,
/*excludeKinds*/
98304 /* Nullable */
);
type.texts = texts;
type.types = types;
return type;
@ -60338,7 +60328,15 @@ ${lanes.join("\n")}
}
function isPatternLiteralPlaceholderType(type) {
if (type.flags & 2097152 /* Intersection */) {
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
let seenPlaceholder = false;
for (const t of type.types) {
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
seenPlaceholder = true;
} else if (!(t.flags & 524288 /* Object */)) {
return false;
}
}
return seenPlaceholder;
}
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
}
@ -60355,7 +60353,7 @@ ${lanes.join("\n")}
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
}
function getGenericObjectFlags(type) {
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
if (type.flags & 3145728 /* UnionOrIntersection */) {
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
}
@ -60367,7 +60365,7 @@ ${lanes.join("\n")}
}
return type.objectFlags & 12582912 /* IsGenericType */;
}
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
}
function getSimplifiedType(type, writing) {
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
@ -61393,7 +61391,7 @@ ${lanes.join("\n")}
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
target.instantiations.set(id, result);
const resultObjectFlags = getObjectFlags(result);
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
@ -66107,8 +66105,8 @@ ${lanes.join("\n")}
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
}
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 138117121 /* ObjectFlagsType */) {
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
if (type.flags & 3899393 /* ObjectFlagsType */) {
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
}
return result;
@ -68626,10 +68624,10 @@ ${lanes.join("\n")}
if (isMatchingConstructorReference(right)) {
return narrowTypeByConstructor(type, operator, left, assumeTrue);
}
if (isBooleanLiteral(right)) {
if (isBooleanLiteral(right) && !isAccessExpression(left)) {
return narrowTypeByBooleanComparison(type, left, right, operator, assumeTrue);
}
if (isBooleanLiteral(left)) {
if (isBooleanLiteral(left) && !isAccessExpression(right)) {
return narrowTypeByBooleanComparison(type, right, left, operator, assumeTrue);
}
break;
@ -135680,7 +135678,7 @@ ${lanes.join("\n")}
options
),
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
jsDocParsingMode: 1 /* ParseNone */
jsDocParsingMode: transpileOptions.jsDocParsingMode ?? 0 /* ParseAll */
}
);
if (transpileOptions.moduleName) {

View file

@ -54,7 +54,7 @@ var path = __toESM(require("path"));
// src/compiler/corePublic.ts
var versionMajorMinor = "5.3";
var version = "5.3.2";
var version = "5.3.3";
// src/compiler/core.ts
var emptyArray = [];
@ -3112,7 +3112,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";

View file

@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "5.3.2",
"version": "5.3.3",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [