|
Download node_modules/get-proto/README.md from Snapkitty/agentscope-sift: direct link, hf CLI and curl.
- Browser
- Download file 1.84 kB
-
https://huggingface.co/Snapkitty/agentscope-sift/resolve/main/node_modules/get-proto/README.md
- Command line
-
hf download hf://Snapkitty/agentscope-sift/node_modules/get-proto/README.md
-
curl -L -o README.md https://huggingface.co/Snapkitty/agentscope-sift/resolve/main/node_modules/get-proto/README.md
1.84 kB
get-proto
Robustly get the [[Prototype]] of an object. Uses the best available method.
Getting started
npm install --save get-proto
Usage/Examples
const assert = require('assert');
const getProto = require('get-proto');
const a = { a: 1, b: 2, [Symbol.toStringTag]: 'foo' };
const b = { c: 3, __proto__: a };
assert.equal(getProto(b), a);
assert.equal(getProto(a), Object.prototype);
assert.equal(getProto({ __proto__: null }), null);
Tests
Clone the repo, npm install, and run npm test
