Convert various values to booleans and check if they are boolean-like.
Install the package using npm:
npm i smart-boolean
Or with yarn:
yarn add smart-boolean
const { boolean, isBooleanable } = require('smart-boolean');
console.log(boolean('yes')); // true
console.log(boolean('maybe')); // false
console.log(isBooleanable('false')); // true
console.log(isBooleanable('123')); // false