import isString from '../../string/isStringPrimitive'
const matchFalse = /^("|')?(false)("|')?$/
/**
* @desc is falsy value
* @since 5.0.0-beta.5
* @memberOf is
*
* @param {null | undefined | false | 0 | '' | *} x value to check
* @return {boolean} x is Falsy
*
* @name isFalsish
*
* @example
*
* isFalsish(null) //=> true
*
*/
const isFalsish = (x: any): x is false | 'false' | '"false"' | `'false'` =>
x === false || (isString(x) && matchFalse.test(x))
export { isFalsish }
export default isFalsish