A small polyfill for Object.setPrototypeOf with cross-platform compatibility
82
A compatibility helper that links plain objects to a base behavior while still working in runtimes that cannot directly rewire prototypes.
@generates
/**
* Connects a target object to a base object, enabling prototype-style access where supported
* and a legacy mixin fallback when requested.
*
* @param {object} target - The object to augment.
* @param {object} base - The object whose behavior should be attached.
* @param {{ forceLegacy?: boolean }} [options] - When true, skip prototype rewiring and perform the legacy mixin path even if prototypes are available.
* @returns {object} The same target object after linkage.
*/
export function bridgePrototype(target, base, options = {});Prototype-adjustment helper used to unify prototype linking with a legacy property-mixin fallback. @satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-setprototypeof