Method
constructor
(
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
Tested by
no test coverage detected