UNPKG

testdouble

Version:

A minimal test double library for TDD with JavaScript

11 lines (10 loc) 431 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lodash_1 = require("../../wrap/lodash"); exports.default = (original, target, name, originalValue, targetValue) => { if (name !== 'prototype' || !lodash_1.default.isFunction(original)) return targetValue; targetValue.__proto__ = originalValue; // eslint-disable-line targetValue.constructor = target; return targetValue; };