( build: ErrorBuilder | undefined, context: ArkErrorContextInput, path: PropertyKey[], data: unknown, config: ResolvedConfig )
| 837 | |
| 838 | // a context's error: built by its compiled builder, or spread where there's none |
| 839 | const errorBuiltBy = ( |
| 840 | build: ErrorBuilder | undefined, |
| 841 | context: ArkErrorContextInput, |
| 842 | path: PropertyKey[], |
| 843 | data: unknown, |
| 844 | config: ResolvedConfig |
| 845 | ): ArkError => |
| 846 | build ? |
| 847 | build(context, path, data, stampError(new StampedFirst(), config)) |
| 848 | : stampError({ data, path, ...context } as never, config) |
| 849 | |
| 850 | // the object a compiled builder assigns an error's keys to: plain, as its |
| 851 | // prototype is Object's, but constructed, so each has the same shape when it's |
no test coverage detected