Files
claude-code/src/ink/wrapAnsi.ts
nirholas ec65e6c251 ☑️ wrapAnsi.ts
2026-03-31 10:23:42 +00:00

22 lines
384 B
TypeScript

import wrapAnsiNpm from 'wrap-ansi'
type WrapAnsiOptions = {
hard?: boolean
wordWrap?: boolean
trim?: boolean
}
const wrapAnsiBun =
typeof Bun !== 'undefined' && typeof Bun.wrapAnsi === 'function'
? Bun.wrapAnsi
: null
const wrapAnsi: (
input: string,
columns: number,
options?: WrapAnsiOptions,
) => string = wrapAnsiBun ?? wrapAnsiNpm
export { wrapAnsi }