MCPcopy Create free account
hub / github.com/Effect-TS/effect / lines

Function lines

packages/effect/src/unstable/cli/Prompt.ts:1432–1440  ·  view source on GitHub ↗
(prompt: string, columns: number)

Source from the content-addressed store, hash-verified

1430}
1431
1432const lines = (prompt: string, columns: number): number => {
1433 const lines = prompt.split(NEWLINE_REGEXP)
1434 return columns === 0
1435 ? lines.length
1436 : pipe(
1437 Arr.map(lines, (line) => Math.ceil(line.length / columns)),
1438 Arr.reduce(0, (left, right) => left + right)
1439 )
1440}
1441
1442const clearOutputWithError = (outputText: string, columns: number, errorText?: string): string => {
1443 if (errorText !== undefined && errorText.length > 0) {

Callers 1

clearOutputWithErrorFunction · 0.85

Calls 3

pipeFunction · 0.90
splitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected