MCPcopy Index your code
hub / github.com/banga/git-split-diffs / wrapString

Function wrapString

src/wrapSpannedStringByWord.test.ts:4–8  ·  view source on GitHub ↗
(string: string, width: number)

Source from the content-addressed store, hash-verified

2import { wrapSpannedStringByWord } from './wrapSpannedStringByWord';
3
4function wrapString(string: string, width: number): string[] {
5 return Array.from(
6 wrapSpannedStringByWord(T().appendString(string), width)
7 ).map((formattedString) => formattedString.getString());
8}
9
10test('single line', () => {
11 expect(wrapString('one two three', 100)).toEqual(['one two three']);

Callers 2

wrapAndJoinFunction · 0.85

Calls 4

wrapSpannedStringByWordFunction · 0.90
TFunction · 0.90
appendStringMethod · 0.80
getStringMethod · 0.80

Tested by

no test coverage detected