mirror of
https://github.com/element-hq/element-web.git
synced 2025-12-05 01:10:40 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
81f1841aea
commit
3d683ec5c6
@@ -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<T extends Node> {
|
||||
public removeNode(node: T): Edge<T>[] {
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user