How to use the isFunctionDeclaration function from typescript

Find comprehensive JavaScript typescript.isFunctionDeclaration code examples handpicked from public code repositorys.

167
168
169
170
171
172
173
174
175
176
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 &&
    s.modifiers.some(
fork icon116
star icon294
watch icon29

+ 3 other calls in file

154
155
156
157
158
159
160
161
162
    const lastArgument = extendCallExpression.arguments[extendCallExpression.arguments.length - 1];
    if (!ts.isIdentifier(lastArgument) || lastArgument.text !== functionParameter.name.text) {
        return false;
    }
    const secondStatement = functionStatements[1];
    return ts.isFunctionDeclaration(secondStatement)
        && secondStatement.name !== undefined
        && returnStatement.expression.text === secondStatement.name.text;
}
fork icon0
star icon0
watch icon1

Other functions in typescript

Sorted by popularity

function icon

typescript.SyntaxKind is the most popular function in typescript (82777 examples)