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.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374/** Configuration errors thrown by the LRU cache factory. Both classes extend `TypeError` to keep the rejection shapes upstream `quick-lru` callers already handle (`instanceof TypeError` keeps holding). @module */
//region Errors
/** Thrown when a `maxSize` value is not truthy and greater than `0`. Thrown by `createQuickLru` for the constructor option and by `resize` for its new bound, matching upstream `quick-lru`'s single `maxSize` diagnostic. @example ```ts import { InvalidMaxSizeError, createQuickLru, } from '\@monochromatic-dev/module-quick-lru-fork'; try { createQuickLru({ maxSize: 0, }); } catch (error) { error instanceof InvalidMaxSizeError; // => true } ``` */export class InvalidMaxSizeError extends TypeError { /** Builds the error with upstream `quick-lru`'s message text so callers migrating from `quick-lru` see identical diagnostics. */ constructor() { super('`maxSize` must be a number greater than 0',); this.name = 'InvalidMaxSizeError'; }}
/** Thrown when the global `maxAge` option is the number `0`. Upstream `quick-lru` rejects exactly `0` here; every other value reaches the cache unchanged, so the fork keeps that acceptance rule and message. @example ```ts import { InvalidMaxAgeError, createQuickLru, } from '\@monochromatic-dev/module-quick-lru-fork'; try { createQuickLru({ maxSize: 1, maxAge: 0, }); } catch (error) { error instanceof InvalidMaxAgeError; // => true } ``` */export class InvalidMaxAgeError extends TypeError { /** Builds the error with upstream `quick-lru`'s message text so callers migrating from `quick-lru` see identical diagnostics. */ constructor() { super('`maxAge` must be a number greater than 0',); this.name = 'InvalidMaxAgeError'; }}
//endregion Errors