Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14739,7 +14739,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
) {
// A reverse mapping of `{[K in keyof T[K_1]]: T[K_1]}` is the same as that of `{[K in keyof T]: T}`, since all we care about is
// inferring to the "type parameter" (or indexed access) shared by the constraint and template. So, to reduce the number of
// type identities produced, we simplify such indexed access occurences
// type identities produced, we simplify such indexed access occurrences
const newTypeParam = (type.constraintType.type as IndexedAccessType).objectType;
Comment on lines 14739 to 14743
const newMappedType = replaceIndexedAccess(type.mappedType, type.constraintType.type as ReplaceableIndexedAccessType, newTypeParam);
inferredProp.links.mappedType = newMappedType as MappedType;
Expand Down Expand Up @@ -16291,7 +16291,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
else {
// Parameter has no annotation
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overriden by contextual type assignment so long as its type hasn't been
// By using a `DeferredType` symbol, we allow the type of this rest arg to be overridden by contextual type assignment so long as its type hasn't been
// cached by `getTypeOfSymbol` yet.
syntheticArgsSymbol.links.checkFlags |= CheckFlags.DeferredType;
syntheticArgsSymbol.links.deferralParent = neverType;
Expand Down Expand Up @@ -31010,7 +31010,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

/**
* This part of `checkIdentifier` is kept seperate from the rest, so `NodeCheckFlags` (and related diagnostics) can be lazily calculated
* This part of `checkIdentifier` is kept separate from the rest, so `NodeCheckFlags` (and related diagnostics) can be lazily calculated
* without calculating the flow type of the identifier.
*/
function checkIdentifierCalculateNodeCheckFlags(node: Identifier, symbol: Symbol) {
Expand Down Expand Up @@ -50787,7 +50787,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
const container = getSourceFileOfNode(symbol.valueDeclaration);
const fileSymbol = container && getSymbolOfDeclaration(container);
// Ensures cjs export assignment is setup, since this symbol may point at, and merge with, the file itself.
// If we don't, the merge may not have yet occured, and the flags check below will be missing flags that
// If we don't, the merge may not have yet occurred, and the flags check below will be missing flags that
// are added as a result of the merge.
void resolveExternalModuleSymbol(fileSymbol);
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4180,12 +4180,12 @@ function getWildcardDirectoryFromSpec(spec: string, useCaseSensitiveFileNames: b
// characters could match any of the central patterns, resulting in bad backtracking.
const questionWildcardIndex = spec.indexOf("?");
const starWildcardIndex = spec.indexOf("*");
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
const lastDirectorySeparatorIndex = spec.lastIndexOf(directorySeparator);
return {
key: toCanonicalKey(match[0], useCaseSensitiveFileNames),
path: match[0],
flags: (questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex)
|| (starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex)
flags: (questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeparatorIndex)
|| (starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeparatorIndex)
? WatchDirectoryFlags.Recursive : WatchDirectoryFlags.None,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,7 @@ function getLoadModuleFromTargetExportOrImport(extensions: Extensions, state: Mo
for (const candidateDir of candidateDirectories) {
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
// The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
const pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory separator
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
const jsAndDtsExtensions = [Extension.Mjs, Extension.Cjs, Extension.Js, Extension.Json, Extension.Dmts, Extension.Dcts, Extension.Dts];
for (const ext of jsAndDtsExtensions) {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9965,7 +9965,7 @@ export function getScriptKindFromFileName(fileName: string): ScriptKind {
}

/**
* Groups of supported extensions in order of file resolution precedence. (eg, TS > TSX > DTS and seperately, CTS > DCTS)
* Groups of supported extensions in order of file resolution precedence. (eg, TS > TSX > DTS and separately, CTS > DCTS)
*/
const supportedTSExtensions: readonly Extension[][] = [[Extension.Ts, Extension.Tsx, Extension.Dts], [Extension.Cts, Extension.Dcts], [Extension.Mts, Extension.Dmts]];
/** @internal */
Expand Down Expand Up @@ -10570,7 +10570,7 @@ export function isValidBigIntString(s: string, roundTripOnly: boolean): boolean
// * scanning proceeded without error
// * a bigint can be scanned, and that when it is scanned, it is
// * the full length of the input string (so the scanner is one character beyond the augmented input length)
// * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
// * it does not contain a numeric separator (the `BigInt` constructor does not accept a numeric separator in its input)
return success && result === SyntaxKind.BigIntLiteral && scanner.getTokenEnd() === (s.length + 1) && !(flags & TokenFlags.ContainsSeparator)
&& (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner.getTokenValue()) }));
}
Expand Down
4 changes: 2 additions & 2 deletions src/services/codefixes/addMissingConst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: Source

const commaExpression = findAncestor(token, node =>
isExpressionStatement(node.parent) ? true :
isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit");
isPossiblyPartOfCommaSeparatedInitializer(node) ? false : "quit");
if (commaExpression) {
const checker = program.getTypeChecker();
if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) {
Expand Down Expand Up @@ -105,7 +105,7 @@ function arrayElementCouldBeVariableDeclaration(expression: Expression, checker:
return !!identifier && !checker.getSymbolAtLocation(identifier);
}

function isPossiblyPartOfCommaSeperatedInitializer(node: Node): boolean {
function isPossiblyPartOfCommaSeparatedInitializer(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.BinaryExpression:
Expand Down
Loading