UNPKG
xprezzo-setprototypeof
Version:
latest (1.1.2)
1.1.2
1.1.1
1.1.0
1.0.0
A small polyfill for Object.setprototypeof
github.com/xprezzo
xprezzo/xprezzo-setprototypeof
xprezzo-setprototypeof
/
index.js
13 lines
(9 loc)
•
289 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
const
mixin =
require
(
'xprezzo-mixin'
);
/* eslint no-proto: 0 */
module
.
exports
=
Object
.
setPrototypeOf
|| ({
__proto__
: [] }
instanceof
Array
? setProtoOf : mixin)
module
.
exports
.
mixin
= mixin;
let
setProtoOf
= (
obj, proto
) => { obj.
__proto__
= proto
return
obj }