Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 276 Bytes

is-regexp.md

File metadata and controls

17 lines (14 loc) · 276 Bytes

isRegExp

/*
isRegExp(val: unknown): boolean
*/

/**
 * Checks that a value is a RegExp instance
 * Uses "val instanceof RegExp" comparison
 */

// Examples
isRegExp(/something/);// true
isRegExp(new RegExp('something'));// true
isRegExp('/something/');// false