A small polyfill for Object.setPrototypeOf with cross-platform compatibility
82
Implement a helper that mutates plain objects to adopt a provided blueprint as their prototype, retaining compatibility in environments that may not support native prototype reassignment.
null as the blueprint to remove the target's prototype, keeping its own properties intact. @test@generates
Attempt prototype reassignment through the provided dependency before applying any fallback copying behavior.
export function rebasePrototype<T extends object>(target: T, blueprint: object | null): T;Provides cross-environment prototype reassignment support, including environments where Object.setPrototypeOf is missing and only __proto__ assignment works.
Install with Tessl CLI
npx tessl i tessl/npm-setprototypeof