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

Method constructor

packages/effect/src/SchemaAST.ts:1299–1311  ·  view source on GitHub ↗
(
    literal: LiteralValue,
    annotations?: Schema.Annotations.Annotations,
    checks?: Checks,
    encoding?: Encoding,
    context?: Context
  )

Source from the content-addressed store, hash-verified

1297 readonly literal: LiteralValue
1298
1299 constructor(
1300 literal: LiteralValue,
1301 annotations?: Schema.Annotations.Annotations,
1302 checks?: Checks,
1303 encoding?: Encoding,
1304 context?: Context
1305 ) {
1306 super(annotations, checks, encoding, context)
1307 if (typeof literal === "number" && !globalThis.Number.isFinite(literal)) {
1308 throw new Error(`A numeric literal must be finite, got ${format(literal)}`)
1309 }
1310 this.literal = literal
1311 }
1312 /** @internal */
1313 getParser() {
1314 return fromConst(this, this.literal)

Callers

nothing calls this directly

Calls 1

formatFunction · 0.90

Tested by

no test coverage detected