( annotations?: AllAnnotations<A, TypeParameters> )
| 253 | } |
| 254 | |
| 255 | const toASTAnnotations = <A, TypeParameters extends ReadonlyArray<any>>( |
| 256 | annotations?: AllAnnotations<A, TypeParameters> |
| 257 | ): AST.Annotations => { |
| 258 | if (!annotations) { |
| 259 | return {} |
| 260 | } |
| 261 | const out: Types.Mutable<AST.Annotations> = { ...annotations } |
| 262 | |
| 263 | for (const key in builtInAnnotations) { |
| 264 | if (key in annotations) { |
| 265 | const id = builtInAnnotations[key as keyof typeof builtInAnnotations] |
| 266 | out[id] = annotations[key as keyof typeof annotations] |
| 267 | delete out[key] |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | return out |
| 272 | } |
| 273 | |
| 274 | const mergeSchemaAnnotations = <A>(ast: AST.AST, annotations: Annotations.Schema<A>): AST.AST => |
| 275 | AST.annotations(ast, toASTAnnotations(annotations)) |
no outgoing calls
no test coverage detected
searching dependent graphs…