X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2FkeysIn.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2FkeysIn.js;h=516e9cf8d489927b74a73c431a717782dd346cb0;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/lodash/keysIn.js b/node_modules/uncss/node_modules/lodash/keysIn.js new file mode 100644 index 000000000..516e9cf8d --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/keysIn.js @@ -0,0 +1,54 @@ +var baseKeysIn = require('./internal/baseKeysIn'), + indexKeys = require('./internal/indexKeys'), + isIndex = require('./internal/isIndex'), + isPrototype = require('./internal/isPrototype'); + +/** Used for built-in method references. */ +var objectProto = global.Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + var index = -1, + isProto = isPrototype(object), + props = baseKeysIn(object), + propsLength = props.length, + indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + while (++index < propsLength) { + var key = props[index]; + if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keysIn;