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

Function lines

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

Source from the content-addressed store, hash-verified

1610}
1611
1612const lines = (prompt: string, columns: number): number => {
1613 const lines = prompt.split(NEWLINE_REGEXP)
1614 return columns === 0
1615 ? lines.length
1616 : pipe(
1617 Arr.map(lines, (line) => Math.ceil(line.length / columns)),
1618 Arr.reduce(0, (left, right) => left + right)
1619 )
1620}
1621
1622const clearOutputWithError = (outputText: string, columns: number, errorText?: string): string => {
1623 if (errorText !== undefined && errorText.length > 0) {

Callers 1

clearOutputWithErrorFunction · 0.70

Calls 3

pipeFunction · 0.90
splitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected