import {CodeNodeDef} from "../../parser/definition/types/CodeNodeDef"; import {DependencyDef} from "../../parser/definition/types/DependencyDef"; import {NodeDef} from "../../parser/definition/types/NodeDef"; import {StructureNodeDef} from "../../parser/definition/types/StructureNodeDef"; import {isCodeNodeDef} from "./isCodeNodeDef"; import {isStructureNodeDef} from "./isStructureNodeDef"; export function getDependenciesFromNodeDef( nodeDef: NodeDef ): Array { if (isCodeNodeDef(nodeDef)) { const codeNodeDef = nodeDef as CodeNodeDef; return codeNodeDef.dependencies; } else if (isStructureNodeDef(nodeDef)) { const structureNodeDef = nodeDef as StructureNodeDef; return structureNodeDef.dependencies; } else { return []; } }