Sha256: ede2714570c0d3f34bd177fb11dbc0667c5d2ca968d4380d3dcbf4c24a6f5bd6

Contents?: true

Size: 1.01 KB

Versions: 273

Compression:

Stored size: 1.01 KB

Contents

var baseAssign = require('./_baseAssign'),
    baseCreate = require('./_baseCreate');

/**
 * Creates an object that inherits from the `prototype` object. If a
 * `properties` object is given, its own enumerable string keyed properties
 * are assigned to the created object.
 *
 * @static
 * @memberOf _
 * @since 2.3.0
 * @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 == null ? result : baseAssign(result, properties);
}

module.exports = create;

Version data entries

273 entries across 271 versions & 29 rubygems

Version Path
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/create.js
immosquare-cleaner-0.1.49 node_modules/lodash/create.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/create.js
immosquare-cleaner-0.1.48 node_modules/lodash/create.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.6 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/lodash/create.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/lodash/create.js