X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=node_modules%2Funcss%2Fnode_modules%2Flodash%2Fcreate.js;fp=node_modules%2Funcss%2Fnode_modules%2Flodash%2Fcreate.js;h=2f120c8ebf617f28c7474d9196996e4222968571;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/uncss/node_modules/lodash/create.js b/node_modules/uncss/node_modules/lodash/create.js new file mode 100644 index 000000000..2f120c8eb --- /dev/null +++ b/node_modules/uncss/node_modules/lodash/create.js @@ -0,0 +1,41 @@ +var baseAssign = require('./internal/baseAssign'), + baseCreate = require('./internal/baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a `properties` + * object is provided its own enumerable properties are assigned to the created object. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? baseAssign(result, properties) : result; +} + +module.exports = create;