CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
README.md51 linesDownload Raw Back to get-proto
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 started13 14```sh15npm install --save get-proto16```17 18## Usage/Examples19 20```js21const 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## Tests33 34Clone the repo, `npm install`, and run `npm test`35 36[package-url]: https://npmjs.org/package/get-proto37[npm-version-svg]: https://versionbadg.es/ljharb/get-proto.svg38[deps-svg]: https://david-dm.org/ljharb/get-proto.svg39[deps-url]: https://david-dm.org/ljharb/get-proto40[dev-deps-svg]: https://david-dm.org/ljharb/get-proto/dev-status.svg41[dev-deps-url]: https://david-dm.org/ljharb/get-proto#info=devDependencies42[npm-badge-png]: https://nodei.co/npm/get-proto.png?downloads=true&stars=true43[license-image]: https://img.shields.io/npm/l/get-proto.svg44[license-url]: LICENSE45[downloads-image]: https://img.shields.io/npm/dm/get-proto.svg46[downloads-url]: https://npm-stat.com/charts.html?package=get-proto47[codecov-image]: https://codecov.io/gh/ljharb/get-proto/branch/main/graphs/badge.svg48[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-proto50[actions-url]: https://github.com/ljharb/get-proto/actions51