my-idlers/node_modules/collect.js/dist/methods/union.js
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

15 lines
326 B
JavaScript
Vendored

'use strict';
module.exports = function union(object) {
var _this = this;
var collection = JSON.parse(JSON.stringify(this.items));
Object.keys(object).forEach(function (prop) {
if (_this.items[prop] === undefined) {
collection[prop] = object[prop];
}
});
return new this.constructor(collection);
};