3 var uniq = require('../array/#/uniq')
4 , value = require('./valid-value')
6 , push = Array.prototype.push
7 , getOwnPropertyNames = Object.getOwnPropertyNames
8 , getPrototypeOf = Object.getPrototypeOf;
10 module.exports = function (obj) {
12 obj = Object(value(obj));
13 keys = getOwnPropertyNames(obj);
14 while ((obj = getPrototypeOf(obj))) {
15 push.apply(keys, getOwnPropertyNames(obj));
17 return uniq.call(keys);