UNPKG

@resk/core

Version:

An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla

16 lines (15 loc) 579 B
/** * Checks if the provided value is a regular expression. * * A value is considered a regular expression if it is an instance of the RegExp constructor, or if it can be converted to a RegExp. * * @param {any} regExp The value to check. * @returns {boolean} True if the value is a regular expression, false otherwise. * @example * ```typescript * console.log(isRegExp(/hello/)); // Output: true * console.log(isRegExp("hello")); // Output: true * console.log(isRegExp({})); // Output: false * ``` */ export default function isRegExp(regExp: any): regExp is RegExp;