How to use the isClassDeclaration function from typescript
Find comprehensive JavaScript typescript.isClassDeclaration code examples handpicked from public code repositorys.
166 167 168 169 170 171 172 173 174 175
ts.isInterfaceDeclaration(s) || ts.isModuleDeclaration(s) || ts.isEnumDeclaration(s) || (isGlobal && ( // in global scripts we don't wrap classes and functions so they can be accessed from non-global scripts ts.isClassDeclaration(s) || ts.isFunctionDeclaration(s) )) || // and declare ... / export ... statements (s.modifiers &&
116
294
29
+ 5 other calls in file
116 117 118 119 120 121 122 123 124 125
[AngularClassDecorators.NgModule, new Set([])], [AngularClassDecorators.Pipe, new Set([AngularLifecycleMethods.ngOnDestroy])] ]); exports.getClassName = function (node) { 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) &&
0
0
1
116 117 118 119 120 121 122 123 124 125
|| !ts.isIdentifier(returnStatement.expression)) { return false; } if (functionExpression.parameters.length === 0) { // potential non-extended class or wrapped es2015 class return (ts.isFunctionDeclaration(firstStatement) || ts.isClassDeclaration(firstStatement)) && firstStatement.name !== undefined && returnStatement.expression.text === firstStatement.name.text; } else if (functionExpression.parameters.length !== 1) {
0
0
1
typescript.SyntaxKind is the most popular function in typescript (82777 examples)