fix delete_systemapi_plugin

Signed-off-by: wangqing <wangqing136@huawei.com>
This commit is contained in:
wangqing 2022-10-20 17:59:18 +08:00
parent fb1c3b0121
commit e57f34e32a

View File

@ -129,6 +129,9 @@ function formatImportDeclaration(url) {
const clauseNode = statement.importClause; const clauseNode = statement.importClause;
if (!clauseNode.namedBindings && clauseNode.name && ts.isIdentifier(clauseNode.name)) { if (!clauseNode.namedBindings && clauseNode.name && ts.isIdentifier(clauseNode.name)) {
clauseSet.add(clauseNode.name.escapedText.toString()); clauseSet.add(clauseNode.name.escapedText.toString());
} else if (clauseNode.namedBindings && clauseNode.namedBindings.name &&
ts.isIdentifier(clauseNode.namedBindings.name)) {
clauseSet.add(clauseNode.namedBindings.name.escapedText.toString());
} else if (clauseNode.namedBindings && clauseNode.namedBindings.elements) { } else if (clauseNode.namedBindings && clauseNode.namedBindings.elements) {
clauseNode.namedBindings.elements.forEach(ele => { clauseNode.namedBindings.elements.forEach(ele => {
if (ele.name && ts.isIdentifier(ele.name)) { if (ele.name && ts.isIdentifier(ele.name)) {