How to use the isCallExpression function from typescript
Find comprehensive JavaScript typescript.isCallExpression code examples handpicked from public code repositorys.
21 22 23 24 25 26 27 28 29 30
*/ 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(
0
0
1
+ 18 other calls in file
1 2 3 4 5 6 7 8 9 10
Object.defineProperty(exports, "__esModule", { value: true }); var ts = require("typescript"); var function_1 = require("./function"); var utils_1 = require("./utils"); function callExpression(dec) { return function_1.Maybe.lift(dec.expression).fmap(function (expr) { return (expr && ts.isCallExpression(expr) ? expr : undefined); }); } exports.callExpression = callExpression; function hasProperties(expr) { return !!(expr && expr.properties);
0
0
1
120 121 122 123 124 125 126 127 128 129
var klass = exports.getNextToLastParentNode(node); return typescript_1.isClassDeclaration(klass) && klass.name ? klass.name.text : undefined; }; exports.getDecorator = function (node, decoratorName) { return typescript_1.createNodeArray(node.decorators).find(function (decorator) { return typescript_1.isCallExpression(decorator.expression) && decorator.expression.arguments && decorator.expression.arguments.length > 0 && exports.getDecoratorName(decorator) === decoratorName; });
0
0
1
329 330 331 332 333 334 335 336 337 338
} if (!callExpr) { return []; } const arrLiteral = expect(callExpr.arguments[0], ts.SyntaxKind.ArrayLiteralExpression); if (!arrLiteral.elements.every((elem) => ts.isCallExpression(elem))) { return []; } const elements = arrLiteral.elements; const ngDecoratorCalls = elements.filter((el) => {
0
0
1
typescript.SyntaxKind is the most popular function in typescript (82777 examples)