UNPKG

bingo-functional-js

Version:

A port of the PHP bingo-functional library

15 lines (12 loc) 253 B
/** * isRegExp function * isRegExp :: a -> Bool * @param {*} val * @returns {boolean} * @example * * isRegExp(/^[a-z]$i/) * // => true */ const isRegExp = (val) => val instanceof Object && val.constructor === RegExp module.exports = isRegExp