(ast: SchemaAST.Arrays, elements: Elements)
| 4447 | } |
| 4448 | |
| 4449 | function makeTuple<Elements extends Tuple.Elements>(ast: SchemaAST.Arrays, elements: Elements): Tuple<Elements> { |
| 4450 | return make(ast, { |
| 4451 | elements, |
| 4452 | mapElements<To extends Tuple.Elements>( |
| 4453 | this: Tuple<Elements>, |
| 4454 | f: (elements: Elements) => To, |
| 4455 | options?: { |
| 4456 | readonly unsafePreserveChecks?: boolean | undefined |
| 4457 | } | undefined |
| 4458 | ): Tuple<Simplify<Readonly<To>>> { |
| 4459 | const elements = f(this.elements) |
| 4460 | return makeTuple(SchemaAST.tuple(elements, options?.unsafePreserveChecks ? this.ast.checks : undefined), elements) |
| 4461 | } |
| 4462 | }) |
| 4463 | } |
| 4464 | /** |
| 4465 | * Defines a tuple schema from a fixed-length tuple of element schemas. |
| 4466 | * |
no test coverage detected