Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
981 bytes
|
Line | |
---|
1 | /*!
|
---|
2 | * assign-symbols <https://github.com/jonschlinkert/assign-symbols>
|
---|
3 | *
|
---|
4 | * Copyright (c) 2015, Jon Schlinkert.
|
---|
5 | * Licensed under the MIT License.
|
---|
6 | */
|
---|
7 |
|
---|
8 | 'use strict';
|
---|
9 |
|
---|
10 | module.exports = function(receiver, objects) {
|
---|
11 | if (receiver === null || typeof receiver === 'undefined') {
|
---|
12 | throw new TypeError('expected first argument to be an object.');
|
---|
13 | }
|
---|
14 |
|
---|
15 | if (typeof objects === 'undefined' || typeof Symbol === 'undefined') {
|
---|
16 | return receiver;
|
---|
17 | }
|
---|
18 |
|
---|
19 | if (typeof Object.getOwnPropertySymbols !== 'function') {
|
---|
20 | return receiver;
|
---|
21 | }
|
---|
22 |
|
---|
23 | var isEnumerable = Object.prototype.propertyIsEnumerable;
|
---|
24 | var target = Object(receiver);
|
---|
25 | var len = arguments.length, i = 0;
|
---|
26 |
|
---|
27 | while (++i < len) {
|
---|
28 | var provider = Object(arguments[i]);
|
---|
29 | var names = Object.getOwnPropertySymbols(provider);
|
---|
30 |
|
---|
31 | for (var j = 0; j < names.length; j++) {
|
---|
32 | var key = names[j];
|
---|
33 |
|
---|
34 | if (isEnumerable.call(provider, key)) {
|
---|
35 | target[key] = provider[key];
|
---|
36 | }
|
---|
37 | }
|
---|
38 | }
|
---|
39 | return target;
|
---|
40 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.