( error: error, label: string )
| 1083 | * writes it as it does its own labeled errors |
| 1084 | */ |
| 1085 | export const asLabeled = <error extends ArkIssue>( |
| 1086 | error: error, |
| 1087 | label: string |
| 1088 | ): error => { |
| 1089 | if (isArkError(error)) templated.add(error) |
| 1090 | labeledIssue(error, label) |
| 1091 | const unlabeled = error.message?.slice(label.length + 1) |
| 1092 | if (unlabeled?.startsWith("must be ")) error.expected = unlabeled.slice(8) |
| 1093 | return error |
| 1094 | } |
| 1095 | |
| 1096 | /** |
| 1097 | * @internal whether an error's message was configured for its Type or code or |
no test coverage detected