1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.defaults = defaults;
|
7 | exports.extend = extend;
|
8 | var arr = [];
|
9 | var each = arr.forEach;
|
10 | var slice = arr.slice;
|
11 |
|
12 | function 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 |
|
23 | function 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 |