mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Refactor named imports to default instead of namespace when esModuleInterop is on and module is an export= (#47744)
This commit is contained in:
@@ -1252,11 +1252,11 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getOwnValues<T>(sparseArray: T[]): T[] {
|
||||
export function getOwnValues<T>(collection: MapLike<T> | T[]): T[] {
|
||||
const values: T[] = [];
|
||||
for (const key in sparseArray) {
|
||||
if (hasOwnProperty.call(sparseArray, key)) {
|
||||
values.push(sparseArray[key]);
|
||||
for (const key in collection) {
|
||||
if (hasOwnProperty.call(collection, key)) {
|
||||
values.push((collection as MapLike<T>)[key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7123,6 +7123,10 @@
|
||||
"category": "Message",
|
||||
"code": 95169
|
||||
},
|
||||
"Convert named imports to default import": {
|
||||
"category": "Message",
|
||||
"code": 95170
|
||||
},
|
||||
|
||||
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
|
||||
"category": "Error",
|
||||
|
||||
Reference in New Issue
Block a user