( error: ArkError, config: ResolvedConfig, locale: Locale.Resolved )
| 962 | writtenLocales.get(error) ?? configOf(error).locale |
| 963 | |
| 964 | const writeError = ( |
| 965 | error: ArkError, |
| 966 | config: ResolvedConfig, |
| 967 | locale: Locale.Resolved |
| 968 | ): void => { |
| 969 | if (locale !== config.locale) writtenLocales.set(error, locale) |
| 970 | const code = error.code |
| 971 | if (code === "union") { |
| 972 | writeAtPaths(error, config, locale) |
| 973 | writeRelative(error, config, locale) |
| 974 | return |
| 975 | } |
| 976 | // any other holds no errors and no bases, so it's written once at its path: |
| 977 | // what writeAtPaths does for it, without reading its code again for each |
| 978 | // question only a union answers |
| 979 | error.propString ??= stringifyPath(error.path) |
| 980 | if (renderer && locale !== renderer.en) renderer.write(error, config, locale) |
| 981 | else writeText(error, config, locale, code) |
| 982 | } |
| 983 | |
| 984 | // the line of a union that lists its errors' whole paths, held as a |
| 985 | // standalone validator's issue holds it, where another copy of arktype reads |
no test coverage detected