( error: ArkError, cited: string | undefined, config: ResolvedConfig, locale: Locale.Resolved )
| 182 | } |
| 183 | |
| 184 | const localeExpected = ( |
| 185 | error: ArkError, |
| 186 | cited: string | undefined, |
| 187 | config: ResolvedConfig, |
| 188 | locale: Locale.Resolved |
| 189 | ): string => { |
| 190 | if (cited !== undefined) |
| 191 | return writeKeywordExpected(error as never, locale) ?? locale.cite(cited) |
| 192 | const expected = locale[error.code]?.expected |
| 193 | if (expected !== undefined) return writeExpected(error, expected, locale) |
| 194 | // written whole in en, never as en's frame around the locale's text |
| 195 | const inEn = unwrittenError(error) |
| 196 | writeInEn(inEn, config, "expected") |
| 197 | return inEn.expected |
| 198 | } |
| 199 | |
| 200 | // only the slots its expected reads, so no writer is called twice |
| 201 | const writeInEn = ( |
no test coverage detected