How to use the isPropertyAccessExpression function from typescript
Find comprehensive JavaScript typescript.isPropertyAccessExpression code examples handpicked from public code repositorys.
22 23 24 25 26 27 28 29 30 31
function logTransformer(context) { return (sourceFile) => { function visit(node) { if ( ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && node.expression.name.text === "log" ) { const logFunc = ts.factory.createStringLiteralFromNode( ts.factory.createStringLiteral('myLog')
0
0
1
+ 18 other calls in file
167 168 169 170 171 172 173 174 175 176
exports.getInjectableDecorator = function (node) { return exports.getDecorator(node, 'Injectable'); }; exports.getNgModuleDecorator = function (node) { return exports.getDecorator(node, 'NgModule'); }; exports.getPipeDecorator = function (node) { return exports.getDecorator(node, 'Pipe'); }; exports.getSymbolName = function (expression) { var childExpression = expression.expression; return typescript_1.isPropertyAccessExpression(childExpression) ? childExpression.name.getText() : childExpression.getText(); }; exports.isAngularClassDecorator = function (value) { return exports.ANGULAR_CLASS_DECORATORS.has(value); };
0
0
1
244 245 246 247 248 249 250 251 252 253
} else if (ts.isBinaryExpression(expression)) { const node = ts.isBinaryExpression(expression.left) ? expression.left.left : expression.left; const leftExpression = ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) // Static Properties // Ex: Foo.bar = 'value'; // ENUM Property // Ex: ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = "Default"; ? node.expression // Ex: FooClass = __decorate([Component()], FooClass);
0
0
1
+ 3 other calls in file
typescript.SyntaxKind is the most popular function in typescript (82777 examples)