( kind: string, inst: Kernel.Instance, ctx: Context.Context<any>, message: () => string )
| 28 | |
| 29 | /** @internal */ |
| 30 | export const warnOnce = ( |
| 31 | kind: string, |
| 32 | inst: Kernel.Instance, |
| 33 | ctx: Context.Context<any>, |
| 34 | message: () => string |
| 35 | ): void => { |
| 36 | const component = inst.component as unknown as Component.Any |
| 37 | let kinds = warned.get(component) |
| 38 | if (kinds === undefined) warned.set(component, kinds = new Set()) |
| 39 | if (kinds.has(kind)) return |
| 40 | kinds.add(kind) |
| 41 | Effect.runForkWith(ctx)( |
| 42 | Effect.logWarning(`${component.definition.name}: ${message()}`) |
| 43 | ) |
| 44 | } |
| 45 | |
| 46 | const formatIssue = SchemaIssue.makeFormatterDefault() |
| 47 |
no test coverage detected