diff --git a/scripts/gen-workflow-mermaid.ts b/scripts/gen-workflow-mermaid.ts index c33398268f..448a9fb8f1 100755 --- a/scripts/gen-workflow-mermaid.ts +++ b/scripts/gen-workflow-mermaid.ts @@ -5,7 +5,7 @@ import path from "node:path"; import YAML from "yaml"; import parseArgs from "minimist"; import cronstrue from "cronstrue"; -import { partition } from "lodash"; +import _ from "lodash"; const argv = parseArgs<{ debug: boolean; @@ -81,7 +81,7 @@ class Graph { public removeNode(node: T): Edge[] { if (!this.nodes.has(node.id)) return []; this.nodes.delete(node.id); - const [removedEdges, keptEdges] = partition( + const [removedEdges, keptEdges] = _.partition( this.edges, ([source, destination]) => source === node || destination === node, ); @@ -384,6 +384,7 @@ class MermaidFlowchartPrinter { private static INDENT = 4; private currentIndent = 0; private text = ""; + private readonly markdown: boolean; public readonly idGenerator = new IdGenerator(); private print(text: string): void { @@ -400,11 +401,8 @@ class MermaidFlowchartPrinter { this.currentIndent += delta * MermaidFlowchartPrinter.INDENT; } - public constructor( - direction: "TD" | "TB" | "BT" | "RL" | "LR", - title?: string, - private readonly markdown = false, - ) { + public constructor(direction: "TD" | "TB" | "BT" | "RL" | "LR", title?: string, markdown = false) { + this.markdown = markdown; if (this.markdown) { this.print("```mermaid"); }