(
base: SchemaRepresentation.Code,
representation: Exclude<SchemaRepresentation.Representation, SchemaRepresentation.Reference>,
path: Path,
includeTypeBrands: boolean = true
)
| 354 | } |
| 355 | |
| 356 | function applyNode( |
| 357 | base: SchemaRepresentation.Code, |
| 358 | representation: Exclude<SchemaRepresentation.Representation, SchemaRepresentation.Reference>, |
| 359 | path: Path, |
| 360 | includeTypeBrands: boolean = true |
| 361 | ): SchemaRepresentation.Code { |
| 362 | const nodeBrands = InternalAnnotations.collectBrands(representation.annotations) |
| 363 | let runtime = base.runtime + runtimeAnnotate(representation.annotations) + runtimeBrands(nodeBrands) |
| 364 | let Type = base.Type + (includeTypeBrands ? typeBrands(nodeBrands) : "") |
| 365 | for (let index = 0; index < representation.checks.length; index++) { |
| 366 | const check = representation.checks[index] |
| 367 | const brands = checkBrands(check) |
| 368 | runtime += `.check(${compileCheck(check, [...path, "checks", index])})${runtimeBrands(brands)}` |
| 369 | if (includeTypeBrands) Type += typeBrands(brands) |
| 370 | } |
| 371 | return makeCode(runtime, Type) |
| 372 | } |
| 373 | |
| 374 | function recur( |
| 375 | representation: SchemaRepresentation.Representation, |
no test coverage detected