Move isObjectLiteralElement to public utilities (#20605)

This commit is contained in:
Andy
2018-01-08 12:29:21 -08:00
committed by GitHub
parent 97c3e9c3ef
commit 6d361f89e3
4 changed files with 17 additions and 14 deletions

View File

@@ -2251,20 +2251,6 @@ namespace ts {
isLiteralComputedPropertyDeclarationName(node);
}
function isObjectLiteralElement(node: Node): node is ObjectLiteralElement {
switch (node.kind) {
case SyntaxKind.JsxAttribute:
case SyntaxKind.JsxSpreadAttribute:
case SyntaxKind.PropertyAssignment:
case SyntaxKind.ShorthandPropertyAssignment:
case SyntaxKind.MethodDeclaration:
case SyntaxKind.GetAccessor:
case SyntaxKind.SetAccessor:
return true;
}
return false;
}
/**
* Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 }
*/