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

Function parseCompilerOptionsFlag

packages/tools/docgen/src/CLI.ts:102–117  ·  view source on GitHub ↗
(name: string, description: string)

Source from the content-addressed store, hash-verified

100const compilerOptionsSchema = Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown))
101
102const parseCompilerOptionsFlag = (name: string, description: string) =>
103 Flag.string(name).pipe(
104 Flag.withDescription(description),
105 Flag.mapEffect((value) =>
106 Schema.decodeUnknownEffect(compilerOptionsSchema)(value).pipe(
107 Effect.mapError((error) =>
108 new CliError.InvalidValue({
109 option: name,
110 value,
111 expected: `a JSON record (${globalThis.String(error)})`,
112 kind: "flag"
113 })
114 )
115 )
116 )
117 )
118
119const parseCompilerOptionsFile = Flag.file("parse-tsconfig-file", { mustExist: true }).pipe(
120 Flag.withDescription("The TypeScript TSConfig file to use for parsing source files"),

Callers 1

CLI.tsFile · 0.85

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected