source: imaps-frontend/node_modules/get-proto/README.md@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.8 KB
Line 
1# get-proto <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
3[![github actions][actions-image]][actions-url]
4[![coverage][codecov-image]][codecov-url]
5[![License][license-image]][license-url]
6[![Downloads][downloads-image]][downloads-url]
7
8[![npm badge][npm-badge-png]][package-url]
9
10Robustly get the [[Prototype]] of an object. Uses the best available method.
11
12## Getting started
13
14```sh
15npm install --save get-proto
16```
17
18## Usage/Examples
19
20```js
21const assert = require('assert');
22const getProto = require('get-proto');
23
24const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
25const b = { c: 3, __proto__: a };
26
27assert.equal(getProto(b), a);
28assert.equal(getProto(a), Object.prototype);
29assert.equal(getProto({ __proto__: null }), null);
30```
31
32## Tests
33
34Clone the repo, `npm install`, and run `npm test`
35
36[package-url]: https://npmjs.org/package/get-proto
37[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg
38[deps-svg]: https://david-dm.org/ljharb/get-proto.svg
39[deps-url]: https://david-dm.org/ljharb/get-proto
40[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg
41[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies
42[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true
43[license-image]: https://img.shields.io/npm/l/get-proto.svg
44[license-url]: LICENSE
45[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg
46[downloads-url]: https://npm-stat.com/charts.html?package=get-proto
47[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg
48[codecov-url]: https://app.codecov.io/gh/ljharb/get-proto/
49[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-proto
50[actions-url]: https://github.com/ljharb/get-proto/actions
Note: See TracBrowser for help on using the repository browser.