mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-28 13:13:37 +08:00
This is need to be able to move to flat config which I am handling in a separate CL. The overrides are there as these packages got update today, so we need to way, but they were last touched 3 years ago, so reviewing their changes upstream as well. Bug: none Change-Id: I61534f881fd4e747c716b42b773f8f7f3e9bc761 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6063618 Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Danil Somsikov <dsv@chromium.org>
47 lines
1.4 KiB
JavaScript
47 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
// modified from https://github.com/es-shims/es6-shim
|
|
var objectKeys = require('object-keys');
|
|
var hasSymbols = require('has-symbols/shams')();
|
|
var callBound = require('call-bind/callBound');
|
|
var toObject = Object;
|
|
var $push = callBound('Array.prototype.push');
|
|
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
|
var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
module.exports = function assign(target, source1) {
|
|
if (target == null) { throw new TypeError('target must be an object'); }
|
|
var to = toObject(target); // step 1
|
|
if (arguments.length === 1) {
|
|
return to; // step 2
|
|
}
|
|
for (var s = 1; s < arguments.length; ++s) {
|
|
var from = toObject(arguments[s]); // step 3.a.i
|
|
|
|
// step 3.a.ii:
|
|
var keys = objectKeys(from);
|
|
var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
|
|
if (getSymbols) {
|
|
var syms = getSymbols(from);
|
|
for (var j = 0; j < syms.length; ++j) {
|
|
var key = syms[j];
|
|
if ($propIsEnumerable(from, key)) {
|
|
$push(keys, key);
|
|
}
|
|
}
|
|
}
|
|
|
|
// step 3.a.iii:
|
|
for (var i = 0; i < keys.length; ++i) {
|
|
var nextKey = keys[i];
|
|
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
|
|
var propValue = from[nextKey]; // step 3.a.iii.2.a
|
|
to[nextKey] = propValue; // step 3.a.iii.2.b
|
|
}
|
|
}
|
|
}
|
|
|
|
return to; // step 4
|
|
};
|