We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c866a9 commit 20f0b50Copy full SHA for 20f0b50
1 file changed
cli/utils/interactive-menu.mjs
@@ -1,6 +1,10 @@
1
import { readdirSync } from 'node:fs';
2
import { join, resolve } from 'node:path';
3
-import { styleText } from 'node:util';
+// `styleText` is only available in Node 21+. To stay compatible with Node 18/20
4
+// we safely import the entire util namespace and fall back to a no-op when
5
+// `styleText` is not present.
6
+import * as util from 'node:util';
7
+const styleText = util.styleText ?? ((_, text) => text);
8
/**
9
* Finds all rules in category and prepares them for display in menu
10
* @param {Record<string, Array<{name: string, path: string, fullPath: string}>>} rules
0 commit comments