/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/jest-watcher/src/lib/patternModeHelpers.ts
34 строки
916 B
Christoph Nakazawa
Stop using `import X = require('…')`. (#15659)
06 июн 2025, 02:49
Не верифицирован
06 июн 2025, 02:49
a2218e4
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import ansiEscapes from 'ansi-escapes'; import chalk from 'chalk'; import stringLength from 'string-length'; export function printPatternCaret( pattern: string, pipe: NodeJS.WritableStream, ): void { const inputText = `${chalk.dim(' pattern \u203A')} ${pattern}`; pipe.write(ansiEscapes.eraseDown); pipe.write(inputText); pipe.write(ansiEscapes.cursorSavePosition); } export function printRestoredPatternCaret( pattern: string, currentUsageRows: number, pipe: NodeJS.WritableStream, ): void { const inputText = `${chalk.dim(' pattern \u203A')} ${pattern}`; pipe.write( ansiEscapes.cursorTo(stringLength(inputText), currentUsageRows - 1), ); pipe.write(ansiEscapes.cursorRestorePosition); }