(tags: Tags)
| 105 | >() {} |
| 106 | |
| 107 | const contextPartial = <Tags extends Record<string, Context.Tag<any, any>>>(tags: Tags): ( |
| 108 | options: { |
| 109 | readonly [K in keyof Tags]?: Context.Tag.Service<Tags[K]> | undefined |
| 110 | } |
| 111 | ) => Context.Context<never> => { |
| 112 | const entries = Object.entries(tags) |
| 113 | return (options) => { |
| 114 | let context = Context.empty() |
| 115 | for (const [key, tag] of entries) { |
| 116 | if (options[key] !== undefined) { |
| 117 | context = Context.add(context, tag, options[key]!) |
| 118 | } |
| 119 | } |
| 120 | return context |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * @since 1.0.0 |
no test coverage detected
searching dependent graphs…