/
mordman
/
claude-code
Обзор
Документация
Войти
/
mordman
/
claude-code
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
utils/execSyncWrapper.ts
38 строк
1 KB
kuberwastaken
new initial commit (history rewritten)
01 апр 2026, 14:57
01 апр 2026, 14:57
c1996f2
Код
Авторство
О чём код?
import { type ExecSyncOptions, type ExecSyncOptionsWithBufferEncoding, type ExecSyncOptionsWithStringEncoding, execSync as nodeExecSync, } from 'child_process' import { slowLogging } from './slowOperations.js' /** * @deprecated Use async alternatives when possible. Sync exec calls block the event loop. * * Wrapped execSync with slow operation logging. * Use this instead of child_process execSync directly to detect performance issues. * * @example * import { execSync_DEPRECATED } from './execSyncWrapper.js' * const result = execSync_DEPRECATED('git status', { encoding: 'utf8' }) */ export function execSync_DEPRECATED(command: string): Buffer export function execSync_DEPRECATED( command: string, options: ExecSyncOptionsWithStringEncoding, ): string export function execSync_DEPRECATED( command: string, options: ExecSyncOptionsWithBufferEncoding, ): Buffer export function execSync_DEPRECATED( command: string, options?: ExecSyncOptions, ): Buffer | string export function execSync_DEPRECATED( command: string, options?: ExecSyncOptions, ): Buffer | string { using _ = slowLogging`execSync: ${command.slice(0, 100)}` return nodeExecSync(command, options) }