function findNearestParentNodeOfKind(from, kind, typescript) {
    let currentParent = from;
    while (true) {
        currentParent = currentParent.parent;
        if (currentParent == null)
            return undefined;
        if (currentParent.kind === kind) {
            const combinedNodeFlags = typescript.getCombinedNodeFlags(currentParent);
            const isNamespace = (combinedNodeFlags & typescript.NodeFlags.Namespace) !== 0 || (combinedNodeFlags & typescript.NodeFlags.NestedNamespace) !== 0;
            if (!isNamespace)
                return currentParent;
        }
        if (typescript.isSourceFile(currentParent))
            return undefined;
    }
}
/**
 * Finds the nearest parent node of the given kind from the given Node
 */
Finds the nearest parent node of the given kind from the given Node
Finds the nearest parent node of the given kind from the given Node
function findNearestParentNodeOfKind(from, kind, typescript) {
    let currentParent = from;
    while (true) {
        currentParent = currentParent.parent;
        if (currentParent == null)
            return undefined;
        if (currentParent.kind === kind) {
            const combinedNodeFlags = typescript.getCombinedNodeFlags(currentParent);
            const isNamespace = (combinedNodeFlags & typescript.NodeFlags.Namespace) !== 0 || (combinedNodeFlags & typescript.NodeFlags.NestedNamespace) !== 0;
            if (!isNamespace)
                return currentParent;
        }
        if (typescript.isSourceFile(currentParent))
            return undefined;
    }
}
function findNearestParentNodeOfKind ( from , kind , typescript ) { let currentParent = from ; while ( true ) { currentParent = currentParent . parent ; if ( currentParent == null ) return undefined ; if ( currentParent . kind === kind ) { const combinedNodeFlags = typescript . getCombinedNodeFlags ( currentParent ) ; const isNamespace = ( combinedNodeFlags & typescript . NodeFlags . Namespace ) !== 0 || ( combinedNodeFlags & typescript . NodeFlags . NestedNamespace ) !== 0 ; if ( ! isNamespace ) return currentParent ; } if ( typescript . isSourceFile ( currentParent ) ) return undefined ; } }
Finds the nearest parent node of the given kind from the given Node
Finds the nearest parent node of the given kind from the given Node