//#region src/is-like/index.d.ts /** * Creates a predicate function that determines if a string matches a given pattern or regular expression. * * @param pattern - The string pattern or RegExp to use for testing * @param input - The string to test against the pattern * * @remarks * - Pure function with no side effects * - Accepts both string patterns and RegExp objects * - String patterns are automatically converted to RegExp using `new RegExp(pattern)` * - Uses RegExp.prototype.test() for pattern matching * - Useful for string validation and array filtering * * @example * ```typescript * const isJsFile = isLike(/\.(js|ts)$/); * isJsFile('app.js'); // true * isJsFile('style.css'); // false * * const hasNumbers = isLike('[0-9]'); * hasNumbers('abc123'); // true * hasNumbers('abcdef'); // false * * const isEmail = isLike(/^[^\s@]+@[^\s@]+\.[^\s@]+$/); * isEmail('user@example.com'); // true * isEmail('invalid-email'); // false * * // Useful with arrays * const files = ['app.js', 'style.css', 'main.ts', 'README.md']; * const scriptFiles = files.filter(isLike(/\.(js|ts)$/)); // ['app.js', 'main.ts'] * ``` */ declare const isLike: (pattern: string | RegExp) => (input: string) => boolean; //#endregion export { isLike }; //# sourceMappingURL=index.d.ts.map