UNPKG

cognitive-complexity-ts

Version:

This program analyses TypeScript and JavaScript code according to the [Cognitive Complexity metric](https://www.sonarsource.com/docs/CognitiveComplexity.pdf). It produces a JSON summary and a GUI for exploring the complexity of your codebase.

21 lines (20 loc) 510 B
/** * Purpose: get children of a node organised by their depth. */ import * as ts from "typescript"; interface DepthOfChildren { /** * The same level of depth. */ same: ts.Node[]; /** * One level of depth below. */ below: ts.Node[]; } /** * @param node The node whose children to categorise by depth * @returns a tuple of [children and the same depth, children at one level below] */ export declare function whereAreChildren(node: ts.Node): DepthOfChildren; export {};