/
githubmirror
/
lerna
Обзор
Документация
Войти
/
githubmirror
/
lerna
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
libs/e2e-utils/src/lib/normalize-fixture-command-output.ts
21 строка
747 B
AI-JamesHenry
chore: adopt node 26 and npm 12 (#4393)
14 июл 2026, 16:57
Не верифицирован
14 июл 2026, 16:57
69fd0fa
Код
Авторство
О чём код?
/** * Remove terminal colors and npm's own launcher notices from the output of * Lerna commands executed through npx. */ export function normalizeFixtureCommandOutput(command: string, output: string): string { const normalizedOutput = stripConsoleColors(output); if (!command.startsWith("npx ") || !command.includes("lerna")) { return normalizedOutput; } return normalizedOutput.replace(/^npm notice run npx\r?\nnpm notice run 'lerna'(?: [^\r\n]*)?\r?\n/gm, ""); } /** * Remove log colors for fail proof string search. */ function stripConsoleColors(log: string): string { // eslint-disable-next-line no-control-regex return log.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, ""); }