import isString from '../../string/isStringPrimitive'
import { isTrue } from './isTrue'
const matchTrue = /^("|')?(true)("|')?$/
/**
* @param {*} x value
* @return {boolean} isTrue
*
* @since 4.0.0-alpha.1
* @memberOf is
* @func isTrue
*
* @example
*
* isTrue('true')
* //=> true
* isTrue('false')
* //=> false
*
*/
const isTruish = (x: any): x is true | 'true' | '"true"' | `'true'` =>
isTrue(x) || (isString(x) && matchTrue.test(x))
export { isTruish, matchTrue }
export default isTruish