keys.js 283 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 module.exports = function keys(obj) { if (Object.keys) { module.exports = function(obj) { return Object.keys(obj) } } else { module.exports = function(obj) { for (var k in obj) { if (obj.hasOwnProperty(k)) { keys.push(k) } } } } return module.exports(obj) }