From 3d683ec5c62963912e153f931a7d71c4bbb4fad3 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 17 Nov 2025 10:33:45 +0000 Subject: [PATCH] Fix gen-workflow-mermaid to be compatible with Node 22.18+ (#31250) * Fix gen-workflow-mermaid to be compatible with Node 22.18+ Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- scripts/gen-workflow-mermaid.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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"); }