Sha256: a6ab709693d3c41fb38d1e21fc3205729d6629d07c1e44b494278610c03fa3d2

Contents?: true

Size: 607 Bytes

Versions: 44

Compression:

Stored size: 607 Bytes

Contents

"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;
};

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
govuk_publishing_components-16.20.0 node_modules/es5-ext/object/mixin-prototypes.js
govuk_publishing_components-16.19.0 node_modules/es5-ext/object/mixin-prototypes.js
govuk_publishing_components-16.18.0 node_modules/es5-ext/object/mixin-prototypes.js
govuk_publishing_components-16.17.0 node_modules/es5-ext/object/mixin-prototypes.js