mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-27 22:26:39 -05:00
Support code-fix-all for importFixes (#25137)
* Support code-fix-all for importFixes * Change description * Update API (#25283)
This commit is contained in:
@@ -531,7 +531,7 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function flatMapIterator<T, U>(iter: Iterator<T>, mapfn: (x: T) => U[] | Iterator<U> | undefined): Iterator<U> {
|
||||
export function flatMapIterator<T, U>(iter: Iterator<T>, mapfn: (x: T) => ReadonlyArray<U> | Iterator<U> | undefined): Iterator<U> {
|
||||
const first = iter.next();
|
||||
if (first.done) {
|
||||
return emptyIterator;
|
||||
@@ -1418,7 +1418,9 @@ namespace ts {
|
||||
return typeof text === "string";
|
||||
}
|
||||
|
||||
export function tryCast<TOut extends TIn, TIn = any>(value: TIn | undefined, test: (value: TIn) => value is TOut): TOut | undefined {
|
||||
export function tryCast<TOut extends TIn, TIn = any>(value: TIn | undefined, test: (value: TIn) => value is TOut): TOut | undefined;
|
||||
export function tryCast<T>(value: T, test: (value: T) => boolean): T | undefined;
|
||||
export function tryCast<T>(value: T, test: (value: T) => boolean): T | undefined {
|
||||
return value !== undefined && test(value) ? value : undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -4474,5 +4474,9 @@
|
||||
"Add missing enum member '{0}'": {
|
||||
"category": "Message",
|
||||
"code": 95063
|
||||
},
|
||||
"Add all missing imports": {
|
||||
"category": "Message",
|
||||
"code": 95064
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4312,8 +4312,8 @@ namespace ts {
|
||||
return !!forEachAncestorDirectory(directory, d => callback(d) ? true : undefined);
|
||||
}
|
||||
|
||||
export function isUMDExportSymbol(symbol: Symbol | undefined) {
|
||||
return symbol && symbol.declarations && symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
||||
export function isUMDExportSymbol(symbol: Symbol | undefined): boolean {
|
||||
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
||||
}
|
||||
|
||||
export function showModuleSpecifier({ moduleSpecifier }: ImportDeclaration): string {
|
||||
@@ -8106,4 +8106,6 @@ namespace ts {
|
||||
|
||||
return findBestPatternMatch(patterns, _ => _, candidate);
|
||||
}
|
||||
|
||||
export type Mutable<T extends object> = { -readonly [K in keyof T]: T[K] };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user