Sha256: c812bbf13fe236360de762df9f3001eb16ad512c7b247f4f21c97693bf0c2af5
Contents?: true
Size: 576 Bytes
Versions: 141
Compression:
Stored size: 576 Bytes
Contents
'use strict'; var isObject = require('is-extendable'); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } var len = arguments.length; for (var i = 1; i < len; i++) { var obj = arguments[i]; if (isObject(obj)) { assign(o, obj); } } return o; }; function assign(a, b) { for (var key in b) { if (hasOwn(b, key)) { a[key] = b[key]; } } } /** * Returns true if the given `key` is an own property of `obj`. */ function hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); }
Version data entries
141 entries across 38 versions & 12 rubygems