✏️ 编辑:create.js
路径:
/home/boguraj1/public_html/jobsite/node_modules/lodash/create.js
大小:1.01 KB · 修改:2022-11-21 20:09:46 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
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;
💾 保存
取消
保存为 UTF-8,换行统一为 LF