| 2645 | /** @internal */ |
| 2646 | export const pickAnnotations = |
| 2647 | (annotationIds: ReadonlyArray<symbol>) => (annotated: Annotated): Annotations | undefined => { |
| 2648 | let out: { [_: symbol]: unknown } | undefined = undefined |
| 2649 | for (const id of annotationIds) { |
| 2650 | if (Object.prototype.hasOwnProperty.call(annotated.annotations, id)) { |
| 2651 | if (out === undefined) { |
| 2652 | out = {} |
| 2653 | } |
| 2654 | out[id] = annotated.annotations[id] |
| 2655 | } |
| 2656 | } |
| 2657 | return out |
| 2658 | } |
| 2659 | |
| 2660 | /** @internal */ |
| 2661 | export const omitAnnotations = |