UNPKG

736 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.objectSpread = objectSpread;
7
8var _keys = require("./keys");
9
10// Copyright 2017-2022 @polkadot/util authors & contributors
11// SPDX-License-Identifier: Apache-2.0
12
13/**
14 * @name objectSpread
15 * @summary Concats all sources into the destination
16 */
17function objectSpread(dest) {
18 for (let i = 0; i < (arguments.length <= 1 ? 0 : arguments.length - 1); i++) {
19 const src = i + 1 < 1 || arguments.length <= i + 1 ? undefined : arguments[i + 1];
20
21 if (src) {
22 const keys = (0, _keys.objectKeys)(src);
23
24 for (let j = 0; j < keys.length; j++) {
25 const key = keys[j];
26 dest[key] = src[key];
27 }
28 }
29 }
30
31 return dest;
32}
\No newline at end of file