safers
Version:
Safely convert to the desired data and error-free refine values.
11 lines (10 loc) • 377 B
JavaScript
import { isBoolean as e } from "../utils/isBoolean.js";
import { isEmptyObject as o } from "../utils/isEmptyObject.js";
import "../../lib/identifyType-d39b7385.js";
import "../utils/isObject.js";
function m(r, t = !1) {
return r === "true" || r === "false" ? r === "true" : e(r) ? r : t || Array.isArray(r) && r.length <= 0 || o(r) ? !1 : !!r;
}
export {
m as toBoolean
};