(
query: { readonly [TypeId]: unknown },
label: string,
log = false
)
| 3527 | * @internal |
| 3528 | */ |
| 3529 | export const snapshotSchema = ( |
| 3530 | query: { readonly [TypeId]: unknown }, |
| 3531 | label: string, |
| 3532 | log = false |
| 3533 | ): Schema.Top => { |
| 3534 | const def = defOf(query) |
| 3535 | return Schema.make( |
| 3536 | new SchemaAST.Declaration( |
| 3537 | [def.args.ast, def.success.ast, def.error.ast], |
| 3538 | snapshotRun(def, label, true), |
| 3539 | { |
| 3540 | expected: "a query result " + quote(label) + " of " + quote(def.name), |
| 3541 | toCodecJson: snapshotJson(def, label, log) |
| 3542 | } as Schema.Annotations.Annotations, |
| 3543 | undefined, |
| 3544 | undefined, |
| 3545 | undefined, |
| 3546 | undefined, |
| 3547 | snapshotRun(def, label, false) |
| 3548 | ) |
| 3549 | ) |
| 3550 | } |
| 3551 | |
| 3552 | const isSnapshotOf = (def: QueryDef, label: string) => (u: unknown): u is SnapshotImpl => |
| 3553 | u instanceof SnapshotImpl && u[SnapshotTypeId].def.name === def.name && |
nothing calls this directly
no test coverage detected