( annotations: Readonly<Record<string, unknown>> )
| 834 | const JsonAnnotationsSchema = Schema.Record(Schema.String, Schema.Json) |
| 835 | |
| 836 | function pruneAnnotations( |
| 837 | annotations: Readonly<Record<string, unknown>> |
| 838 | ): Option.Option<Readonly<Record<string, Schema.Json>>> { |
| 839 | const out: Record<string, Schema.Json> = {} |
| 840 | for (const [key, value] of Object.entries(annotations)) { |
| 841 | if (SchemaAST.isJson(value)) { |
| 842 | InternalRecord.assignProperty(out, key, value) |
| 843 | } |
| 844 | } |
| 845 | return Object.keys(out).length === 0 ? Option.none() : Option.some(out) |
| 846 | } |
| 847 | |
| 848 | const AnnotationsSchema = Schema.optional(LiveAnnotationsSchema).pipe( |
| 849 | Schema.encodeTo(Schema.optionalKey(JsonAnnotationsSchema), { |
no test coverage detected