Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | var defineProperty = require("./defineProperty.js");
|
---|
| 2 |
|
---|
| 3 | function ownKeys(object, enumerableOnly) {
|
---|
| 4 | var keys = Object.keys(object);
|
---|
| 5 |
|
---|
| 6 | if (Object.getOwnPropertySymbols) {
|
---|
| 7 | var symbols = Object.getOwnPropertySymbols(object);
|
---|
| 8 |
|
---|
| 9 | if (enumerableOnly) {
|
---|
| 10 | symbols = symbols.filter(function (sym) {
|
---|
| 11 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
---|
| 12 | });
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | keys.push.apply(keys, symbols);
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | return keys;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | function _objectSpread2(target) {
|
---|
| 22 | for (var i = 1; i < arguments.length; i++) {
|
---|
| 23 | var source = arguments[i] != null ? arguments[i] : {};
|
---|
| 24 |
|
---|
| 25 | if (i % 2) {
|
---|
| 26 | ownKeys(Object(source), true).forEach(function (key) {
|
---|
| 27 | defineProperty(target, key, source[key]);
|
---|
| 28 | });
|
---|
| 29 | } else if (Object.getOwnPropertyDescriptors) {
|
---|
| 30 | Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
---|
| 31 | } else {
|
---|
| 32 | ownKeys(Object(source)).forEach(function (key) {
|
---|
| 33 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
---|
| 34 | });
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | return target;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | module.exports = _objectSpread2;
|
---|
| 42 | module.exports["default"] = module.exports, module.exports.__esModule = true; |
---|
Note:
See
TracBrowser
for help on using the repository browser.