/** * Miyabi MCP Bundle - Validation Utilities * * General-purpose validation and transformation functions. */ /** * Clamp a value to a range with a default fallback * Replaces 37+ repeated Math.min(Math.max(...)) patterns * * @example * // Before: const limit = Math.min(Math.max((args.limit as number) || 20, 1), 100); * // After: const limit = clampRange(args.limit, 1, 100, 20); */ export declare function clampRange(value: unknown, min: number, max: number, defaultValue: number): number; /** * Parse and clamp an integer value */ export declare function clampInt(value: unknown, min: number, max: number, defaultValue: number): number; /** * Parse lines from command output * Replaces 8+ repeated stdout.trim().split('\n').filter(Boolean) patterns */ export declare function parseLines(stdout: string): string[]; /** * Parse first line from command output */ export declare function parseFirstLine(stdout: string): string; /** * Safe string conversion */ export declare function toString(value: unknown): string; /** * Safe optional string extraction */ export declare function toOptionalString(value: unknown): string | undefined; /** * Parse boolean from various input types */ export declare function toBoolean(value: unknown, defaultValue?: boolean): boolean; /** * Ensure value is an array */ export declare function toArray(value: T | T[] | undefined | null): T[]; /** * Limit array to first N items */ export declare function limitArray(arr: T[], limit: number): T[]; /** * Check if value is a non-null object */ export declare function isObject(value: unknown): value is Record; /** * Safe property access with default */ export declare function getProp(obj: Record, key: string, defaultValue: T): T; //# sourceMappingURL=validation.d.ts.map