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

Function getInitialIndentation

packages/printer/src/internal/layout.ts:387–400  ·  view source on GitHub ↗
(self: DocStream.DocStream<A>)

Source from the content-addressed store, hash-verified

385}
386
387const getInitialIndentation = <A>(self: DocStream.DocStream<A>): Option.Option<number> => {
388 let stream: DocStream.DocStream<A> = self
389 while (
390 stream._tag === "LineStream" ||
391 stream._tag === "PushAnnotationStream" ||
392 stream._tag === "PopAnnotationStream"
393 ) {
394 if (stream._tag === "LineStream") {
395 return Option.some(stream.indentation)
396 }
397 stream = stream.stream
398 }
399 return Option.none()
400}
401
402// -----------------------------------------------------------------------------
403// unbounded

Callers 1

fitsSmartLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…