frontend/.pnpm-store/v3/files/42/ad326c95dbdc1ec39f4f76830c699d0a1908505bbe2cbfd06dbf314bd0cc8319444900ab5dd8c8b3fd29ac07d9abbb8ae9bebf3f85cc12abd558ca05da0a5f

26 lines
607 B
Plaintext

"use strict";
var value = require("./valid-value")
, mixin = require("./mixin");
var getPrototypeOf = Object.getPrototypeOf;
module.exports = function (target, source) {
target = Object(value(target));
source = Object(value(source));
if (target === source) return target;
var sources = [];
while (source && !isPrototypeOf.call(source, target)) {
sources.unshift(source);
source = getPrototypeOf(source);
}
var error;
sources.forEach(function (sourceProto) {
try { mixin(target, sourceProto); } catch (mixinError) { error = mixinError; }
});
if (error) throw error;
return target;
};