UNPKG

631 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.defaults = defaults;
7exports.extend = extend;
8var arr = [];
9var each = arr.forEach;
10var slice = arr.slice;
11
12function defaults(obj) {
13 each.call(slice.call(arguments, 1), function (source) {
14 if (source) {
15 for (var prop in source) {
16 if (obj[prop] === undefined) obj[prop] = source[prop];
17 }
18 }
19 });
20 return obj;
21}
22
23function extend(obj) {
24 each.call(slice.call(arguments, 1), function (source) {
25 if (source) {
26 for (var prop in source) {
27 obj[prop] = source[prop];
28 }
29 }
30 });
31 return obj;
32}
\No newline at end of file