Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ganuz/find-prototype-of

yisraelx19MIT0.1.1TypeScript support: included

Find Prototype Of is package from Ganuz library

chain, modular, modules, proto, prototype, utilities, utils

readme

@ganuz/find-prototype-of

Source Code Version MIT License Bundle Size TypeScript

Find Prototype Of is package from Ganuz library

Install

$ yarn add @ganuz/find-prototype-of

Or

$ npm install --save @ganuz/find-prototype-of

Use

Module

import {
  default as findPrototypeOf
} from '@ganuz/find-prototype-of';

Browser

<script src="https://unpkg.com/@ganuz/find-prototype-of/bundle.umd.min.js"></script>
let {
  findPrototypeOf
} = G;

Examples

 findPrototypeOf(null, proto => proto); // throw TypeError
 findPrototypeOf({}, proto => proto); // => null
 findPrototypeOf({foo: 'bar', [Symbol.toStringTag]: 'Foo'}, proto => proto.foo); // => Foo{foo: 'bar'}
 findPrototypeOf(function (){}, proto => proto.hasOwnProperty('hasOwnProperty')); // => Object.prototype
 let a = Object.create(null, {color: {value: 'red'}});
 let b = Object.create(a, {color: {value: 'blue'}});
 let c = Object.create(b, {color: {value: 'green'}});

 findPrototypeOf(c, (proto) => proto.color === 'blue') === b; // => true
 findPrototypeOf(c, (proto) => proto.color === 'pink'); // => null
 findPrototypeOf(c, (proto) => console.log(`color: ${proto.color}`));
 // => 'color: green'
 // => 'color: blue'
 // => 'color: red'
 // => null

License

Copyright © Yisrael Eliev, Licensed under the MIT license.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.1.1 (2019-04-16)

Note: Version bump only for package @ganuz/find-prototype-of

0.1.0 (2019-04-02)

Features