UNPKG

hd-utils

Version:

A handy utils for modern JS developers

15 lines (14 loc) 517 B
/** * @description Will return the length of the passed param wether if it was obj, array or a string. * @example count([1,2,3]) => 3 * @example count("js") => 2 * @example count(" ", {trimString:true}) => 0 * @example count(" ", {trimString:false}) => 2 * @example count({a:1,b:2}) => 2 * @example count(true) => 1 * @example count(false) => 0 * @example count({a:1,b:2}) => 2 */ export default function count(input?: {} | [] | string | number | boolean, options?: { trimString: boolean; }): number;