Add importKind to ImportDeclaration in babel/types

This commit is contained in:
Nicolò Ribaudo 2019-02-12 11:29:43 +01:00
parent 4ba998c5db
commit b6300a0869

View File

@ -322,6 +322,11 @@ defineType("ImportDeclaration", {
source: { source: {
validate: assertNodeType("StringLiteral"), validate: assertNodeType("StringLiteral"),
}, },
importKind: {
// Handle Flowtype's extension "import {typeof foo} from"
validate: assertOneOf("type", "typeof", "value"),
optional: true,
},
}, },
}); });
@ -357,7 +362,8 @@ defineType("ImportSpecifier", {
}, },
importKind: { importKind: {
// Handle Flowtype's extension "import {typeof foo} from" // Handle Flowtype's extension "import {typeof foo} from"
validate: assertOneOf(null, "type", "typeof"), validate: assertOneOf("type", "typeof"),
optional: true,
}, },
}, },
}); });