UNPKG

hd-utils

Version:

A handy utils for modern JS developers

16 lines (15 loc) 688 B
/** * @description will check if the passed object has values. * If truthyValues is passed then will check if values are truthy => 0 is false, empty string also false and so on. * you can pass predict callback. * * @example isObjHasValues({a:1}) => true * @example isObjHasValues({a:""}) => true * @example isObjHasValues({a:""}, {truthyValues:true}) => false * @example isObjHasValues({a:"1"}, {truthyValues:true}) => true * @example isObjHasValues({a:"1"}, {predict:val => typeof val === "number"}) => false */ export default function isObjHasValues(param: {} | object, { predict, truthyValues, }: { truthyValues: boolean; predict?: (p?: any) => boolean; }): boolean;