Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function length(obj) {
if (Util.isArray(obj)) {
return obj.length;
} else if (Util.isObject(obj)) {
return Object.keys(obj).length;
}
return 0;
}