| 398 | // as arktype's writeInvalidGenericArgCountMessage writes it for an |
| 399 | // instantiation in a string, like box<a, b>, which is checked as it's parsed |
| 400 | const writeArgCountMessage = ( |
| 401 | name: string, |
| 402 | params: array<string>, |
| 403 | args: array<string> |
| 404 | ): string => |
| 405 | `${name}<${params.join(", ")}> requires exactly ${params.length} args (got ${ |
| 406 | args.length |
| 407 | }${args.length === 0 ? "" : `: ${args.join(", ")}`})` |
| 408 | |
| 409 | export const writeUnclosedGenericCycleMessage = (name: string): string => |
| 410 | `Instantiating ${name} recursed with new arguments more than ${maxOpenInstantiations} times` |