Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107/** Configuration errors thrown by the wildcard matcher. Both classes extend `TypeError` to keep the rejection shapes upstream `matcher` callers already handle (`instanceof TypeError` keeps holding). @module */
//region Errors
/** Thrown when an `inputs` value is not a string, a string list, or `undefined`, or when an `inputs` list holds a non-string entry. Carries upstream `matcher`'s message text verbatim, so migrating callers see identical diagnostics. @example ```ts import { InvalidInputsError, matcher, } from '\@monochromatic-dev/module-matcher-fork'; try { matcher(1, 'a',); } catch (error) { error instanceof InvalidInputsError; // => true } ``` */export class InvalidInputsError extends TypeError { /** Builds the error with upstream `matcher`'s message text so callers migrating from `matcher` see identical diagnostics. @param value - Offending `inputs` value, rendered into the message. @param element - Offending list entry, rendered into the message when the list itself is an array. */ constructor( { value, element, }: { readonly value?: unknown; readonly element?: unknown; } = {}, ) { super( (element === undefined) ? `Expected 'inputs' to be a string or an array, but got a type of '${typeof value}'` : `Expected 'inputs' to be an array of strings, but found a type of '${typeof element}' in the array`, ); this.name = 'InvalidInputsError'; }}
/** Thrown when a `patterns` value is not a string, a string list, or `undefined`, or when a `patterns` list holds a non-string entry. Carries upstream `matcher`'s message text verbatim, so migrating callers see identical diagnostics. @example ```ts import { InvalidPatternsError, matcher, } from '\@monochromatic-dev/module-matcher-fork'; try { matcher('a', 1,); } catch (error) { error instanceof InvalidPatternsError; // => true } ``` */export class InvalidPatternsError extends TypeError { /** Builds the error with upstream `matcher`'s message text so callers migrating from `matcher` see identical diagnostics. @param value - Offending `patterns` value, rendered into the message. @param element - Offending list entry, rendered into the message when the list itself is an array. */ constructor( { value, element, }: { readonly value?: unknown; readonly element?: unknown; } = {}, ) { super( (element === undefined) ? `Expected 'patterns' to be a string or an array, but got a type of '${typeof value}'` : `Expected 'patterns' to be an array of strings, but found a type of '${typeof element}' in the array`, ); this.name = 'InvalidPatternsError'; }}
//endregion Errors