How to use the isExpressionStatement function from typescript
Find comprehensive JavaScript typescript.isExpressionStatement code examples handpicked from public code repositorys.
360 361 362 363 364 365 366 367 368 369
// Wrap all declarations that augment global interfaces in `declare global` const augmentations = node.statements.filter((s) => isGlobalAugmentation(s)); const nonAugmentations = node.statements.filter((s) => !isGlobalAugmentation(s)); // If there is no top level await, don't move all the statements around const hasTLA = node.statements.some(s => ts.isExpressionStatement(s) && s.expression.kind === ts.SyntaxKind.AwaitExpression); // Move all statements to the top of the file that cannot appear in a function body let hoistedStatements = hasTLA ? ts.createNodeArray(nonAugmentations.filter((s) => mustBeHoisted(s, isGlobal))) : ts.createNodeArray(nonAugmentations); // The rest gets wrapped
116
294
29
62 63 64 65 66 67 68 69 70 71
const variable = assignment.expression.getChildAt(0); if (ts.isPropertyAccessExpression(variable)) { const object = variable.expression; const propertyName = variable.name; if ( ts.isExpressionStatement(object) && ts.isIdentifier(propertyName) && propertyName.text === "variable" ) { const newAssignment = ts.factory.createAssignment(
0
0
1
+ 37 other calls in file
typescript.SyntaxKind is the most popular function in typescript (82777 examples)