@ganuz/append-prototype-of
v0.1.1
Published
Append Prototype Of is package from Ganuz library
Downloads
7
Maintainers
Readme
@ganuz/append-prototype-of
Append Prototype Of is package from Ganuz library
Install
$ yarn add @ganuz/append-prototype-of
Or
$ npm install --save @ganuz/append-prototype-of
Use
Module
import {
default as appendPrototypeOf
} from '@ganuz/append-prototype-of';
Browser
<script src="https://unpkg.com/@ganuz/append-prototype-of/bundle.umd.min.js"></script>
let {
appendPrototypeOf
} = G;
Examples
appendPrototypeOf(null, {}); // throw TypeError
appendPrototypeOf({}, undefined); // => throw TypeError
appendPrototypeOf({}, null); // => true
appendPrototypeOf(class Foo{}, class Some{}); // => true
appendPrototypeOf(Object.preventExtensions({foo: 'bar'}), null); // => false
appendPrototypeOf(Object, function(){}); // => false
appendPrototypeOf(Object.prototype, {}); // => false
appendPrototypeOf(String.prototype, {}); // => false
appendPrototypeOf(Object('foo'), {}); // => true
Note: it will append proto
to target
on the last proto of prototype chain that is not native.
License
Copyright © Yisrael Eliev, Licensed under the MIT license.