{"_id":"protochain","_rev":"86766","name":"protochain","description":"Get the prototype chain of any value as an Array","dist-tags":{"latest":"1.0.5"},"maintainers":[{"name":"timoxley","email":""}],"time":{"modified":"2021-06-03T10:28:10.000Z","created":"2015-03-06T03:02:38.248Z","1.0.5":"2016-06-30T07:40:22.704Z","1.0.4":"2016-06-30T06:33:13.455Z","1.0.3":"2015-06-29T11:17:30.631Z","1.0.2":"2015-03-07T02:35:25.435Z","1.0.1":"2015-03-06T04:03:37.158Z","1.0.0":"2015-03-06T03:02:38.248Z"},"users":{"chocolateboy":true},"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"versions":{"1.0.5":{"name":"protochain","version":"1.0.5","description":"Get the prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js && standard index.js test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"babel":{"presets":["es2015"]},"keywords":["object","inherit","inheritance","prototypical","prototype","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","standard":"^7.1.2","tape":"^4.6.0"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"eece11ecc91e46e0cc55f1b3510f584239966afd","_id":"protochain@1.0.5","_shasum":"991c407e99de264aadf8f81504b5e7faf7bfa260","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"991c407e99de264aadf8f81504b5e7faf7bfa260","size":3624,"noattachment":false,"key":"/protochain/-/protochain-1.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.5.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/protochain-1.0.5.tgz_1467272419690_0.4231074433773756"},"directories":{},"publish_time":1467272422704,"_cnpm_publish_time":1467272422704,"_hasShrinkwrap":false},"1.0.4":{"name":"protochain","version":"1.0.4","description":"Get the prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js && standard index.js test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"babel":{"presets":["es2015"]},"keywords":["object","inherit","inheritance","prototypical","prototype","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel-cli":"^6.10.1","babel-preset-es2015":"^6.9.0","standard":"^7.1.2","tape":"^4.6.0"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"46cea16c5c3f3889f94b9f1bea83df1bb12b2690","_id":"protochain@1.0.4","_shasum":"100e614979f4b8aa05a6df34b49ef97fa8f7b969","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"100e614979f4b8aa05a6df34b49ef97fa8f7b969","size":3591,"noattachment":false,"key":"/protochain/-/protochain-1.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.4.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/protochain-1.0.4.tgz_1467268390503_0.21997179673053324"},"directories":{},"publish_time":1467268393455,"_cnpm_publish_time":1467268393455,"deprecated":"Maligned default export for CommonJS consumers. Please update to ^1.0.5.","_hasShrinkwrap":false},"1.0.3":{"name":"protochain","version":"1.0.3","description":"Prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"keywords":["object","inherit","prototypical","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel":"^5.6.14","tape":"^4.0.0"},"repository":{"type":"git","url":"git+https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"9135625a00fe038926486e23662da516d2f3aef1","_id":"protochain@1.0.3","_shasum":"da0c160d674d6ac4d072778ba5ae3e24b4e1475c","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.1","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"da0c160d674d6ac4d072778ba5ae3e24b4e1475c","size":3349,"noattachment":false,"key":"/protochain/-/protochain-1.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.3.tgz"},"directories":{},"publish_time":1435576650631,"_cnpm_publish_time":1435576650631,"_hasShrinkwrap":false},"1.0.2":{"name":"protochain","version":"1.0.2","description":"Prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"keywords":["object","inherit","prototypical","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel":"^4.6.6","tape":"^3.5.0"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"742e6a8276e7ec561b2474893c24c9370ec78335","_id":"protochain@1.0.2","_shasum":"92115581c8bc0382a7ad0d0c78a355173633de50","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"92115581c8bc0382a7ad0d0c78a355173633de50","size":3238,"noattachment":false,"key":"/protochain/-/protochain-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.2.tgz"},"directories":{},"publish_time":1425695725435,"_cnpm_publish_time":1425695725435,"_hasShrinkwrap":false},"1.0.1":{"name":"protochain","version":"1.0.1","description":"Prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"keywords":["object","inherit","prototypical","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel":"^4.6.6","tape":"^3.5.0"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"b5d04f91c7bab574d9ac2c35b38ec69993f67aa9","_id":"protochain@1.0.1","_shasum":"f505743b40ebe839d17e70d561638780bb970af0","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.10.36","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"f505743b40ebe839d17e70d561638780bb970af0","size":2680,"noattachment":false,"key":"/protochain/-/protochain-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.1.tgz"},"directories":{},"publish_time":1425614617158,"_cnpm_publish_time":1425614617158,"_hasShrinkwrap":false},"1.0.0":{"name":"protochain","version":"1.0.0","description":"Prototype chain of any value as an Array","main":"protochain.js","scripts":{"test":"(babel test.js > protochain-test.js) && tape protochain-test.js","prepublish":"babel index.js > protochain.js","pretest":"npm run prepublish","posttest":"rm protochain-test.js"},"keywords":["object","inherit","prototypical","utility","proto","hierarchy","ancestors","grandparents","parents"],"author":{"name":"Tim Oxley","email":"secoif@gmail.com"},"license":"ISC","devDependencies":{"babel":"^4.6.6","tape":"^3.5.0"},"dependencies":{"babel":"^4.6.6","tape":"^3.5.0"},"repository":{"type":"git","url":"https://github.com/timoxley/protochain.git"},"bugs":{"url":"https://github.com/timoxley/protochain/issues"},"homepage":"https://github.com/timoxley/protochain","gitHead":"42871b510e8b51650bdf183d37fa58b0650aad90","_id":"protochain@1.0.0","_shasum":"9f4a30b2890878cba0a86a4c8db95cc147a61d1b","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.10.36","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"maintainers":[{"name":"timoxley","email":""}],"dist":{"shasum":"9f4a30b2890878cba0a86a4c8db95cc147a61d1b","size":2009,"noattachment":false,"key":"/protochain/-/protochain-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/protochain/download/protochain-1.0.0.tgz"},"directories":{},"publish_time":1425610958248,"_cnpm_publish_time":1425610958248,"_hasShrinkwrap":false}},"readme":"# protochain\n\n[![Build Status](https://travis-ci.org/timoxley/protochain.svg?branch=master)](https://travis-ci.org/timoxley/protochain)\n\nGet the prototype chain of an object or primitive as an Array.\n\n## Why\n\nI often write this function, figure I should extract it. There are\nprobably other utilities out there that do this but I couldn't find\nthem so they're either poorly named/described or the search algorithm is not being very helpful or I simply searched for the wrong things.\n\n## Installation\n\n```\n> npm install protochain\n```\n\n## Usage\n\n### ES5\n\n```js\nvar protochain = require('protochain')\n\nprotochain({})\n// => [Object.prototype]\n\nprotochain(Object.create(null))\n// => []\n\nprotochain(new Error('message'))\n// => [Error.prototype, Object.prototype]\n\nprotochain(new TypeError('message'))\n// => [TypeError.prototype, Error.prototype, Object.prototype]\n\n// Inheritance\n\nfunction Person() {\n\n}\n\nfunction FancyPerson() {\n  Person.call(this)\n}\n\nFancyPerson.prototype = Object.create(Person.prototype)\n\nprotochain(new Person())\n// => [Person.prototype, Object.prototype]\n\nprotochain(new FancyPerson())\n// => [FancyPerson.prototype, Person.prototype, Object.prototype]\n\n// Primitives are OK\n\nprotochain(123)\n// => [Number.prototype, Object.prototype]\n\nprotochain('abc')\n// => [String.prototype, Object.prototype]\n\nprotochain(/abc/)\n// => [RegExp.prototype, Object.prototype]\n\nprotochain(true)\n// => [Boolean.prototype, Object.prototype]\n\nprotochain(false)\n// => [Boolean.prototype, Object.prototype]\n\n// Null & Undefined === Empty List\n\nprotochain(null)\n// => []\n\nprotochain(undefined)\n// => []\n\nprotochain()\n// => []\n```\n\n### ES6\n\n```js\n\nimport protochain from 'protochain'\n\nclass Person {}\nclass FancyPerson extends Person {}\n\nprotochain(new Person())\n// => [Person.prototype, Object.prototype]\n\nprotochain(new FancyPerson())\n// => [FancyPerson.prototype, Person.prototype, Object.prototype])\n\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/timoxley/protochain","bugs":{"url":"https://github.com/timoxley/protochain/issues"},"license":"ISC"}