{"id":27944927,"url":"https://github.com/es-shims/reflect.getprototypeof","last_synced_at":"2025-05-07T12:55:15.716Z","repository":{"id":55050349,"uuid":"329097014","full_name":"es-shims/Reflect.getPrototypeOf","owner":"es-shims","description":"An ES2015 mostly-spec-compliant `Reflect.getPrototypeOf` sham/polyfill/replacement that works in as many engines as possible.","archived":false,"fork":false,"pushed_at":"2025-01-02T21:23:11.000Z","size":149,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T12:55:05.831Z","etag":null,"topics":["ecmascript","getprototypeof","javascript","polyfill","reflect","shim"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/es-shims.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":"npm/es5-shim","community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-01-12T19:56:13.000Z","updated_at":"2025-01-02T21:23:14.000Z","dependencies_parsed_at":"2024-03-17T07:40:38.117Z","dependency_job_id":"d8d82485-a0bf-49fc-97c5-58f96ff87da1","html_url":"https://github.com/es-shims/Reflect.getPrototypeOf","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"8a81169a80cc77aeafc33b47e8d61856f2605eff"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FReflect.getPrototypeOf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FReflect.getPrototypeOf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FReflect.getPrototypeOf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/es-shims%2FReflect.getPrototypeOf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/es-shims","download_url":"https://codeload.github.com/es-shims/Reflect.getPrototypeOf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252882792,"owners_count":21819155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecmascript","getprototypeof","javascript","polyfill","reflect","shim"],"created_at":"2025-05-07T12:55:14.600Z","updated_at":"2025-05-07T12:55:15.710Z","avatar_url":"https://github.com/es-shims.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://tidelift.com/funding/github/npm/es5-shim"],"categories":[],"sub_categories":[],"readme":"# reflect.getprototypeof \u003csup\u003e[![Version Badge][npm-version-svg]][package-url]\u003c/sup\u003e\n\n[![github actions][actions-image]][actions-url]\n[![coverage][codecov-image]][codecov-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nAn ES2015 mostly-spec-compliant `Reflect.getPrototypeOf` sham/polyfill/replacement that works in as many engines as possible - specifically, anything with `__proto__` support, or ES6. Built-in types will also work correctly in older engines.\n\nThis package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://www.ecma-international.org/ecma-262/5.1/).\n\n## Example\n\n```js\nvar getPrototypeOf = require('reflect.getprototypeof');\nvar assert = require('assert');\n\nassert.throws(() =\u003e getPrototypeOf(true));\nassert.throws(() =\u003e getPrototypeOf(42));\nassert.throws(() =\u003e getPrototypeOf(''));\nassert.equal(getPrototypeOf(/a/g), RegExp.prototype);\nassert.equal(getPrototypeOf(new Date()), Date.prototype);\nassert.equal(getPrototypeOf(function () {}), Function.prototype);\nassert.equal(getPrototypeOf([]), Array.prototype);\nassert.equal(getPrototypeOf({}), Object.prototype);\n```\n\n```js\nvar getPrototypeOf = require('reflect.getprototypeof');\nvar assert = require('assert');\n/* when Reflect or Reflect.getPrototypeOf is not present */\nif (typeof Reflect === 'object') { delete Reflect.getPrototypeOf; }\ndelete globalThis.Reflect;\nvar shimmed = getPrototypeOf.shim();\nassert.equal(shimmed, getPrototypeOf.getPolyfill());\n\nassert.throws(() =\u003e Reflect.getPrototypeOf(true));\nassert.throws(() =\u003e Reflect.getPrototypeOf(42));\nassert.throws(() =\u003e Reflect.getPrototypeOf(''));\nassert.equal(Reflect.getPrototypeOf(/a/g), RegExp.prototype);\nassert.equal(Reflect.getPrototypeOf(new Date()), Date.prototype);\nassert.equal(Reflect.getPrototypeOf(function () {}), Function.prototype);\nassert.equal(Reflect.getPrototypeOf([]), Array.prototype);\nassert.equal(Reflect.getPrototypeOf({}), Object.prototype);\n```\n\n```js\nvar getPrototypeOf = require('reflect.getprototypeof');\nvar assert = require('assert');\n/* when Reflect.getPrototypeOf is present */\nvar shimmedGetPrototypeOf = getPrototypeOf.shim();\nassert.equal(shimmedGetPrototypeOf, Reflect.getPrototypeOf);\nassert.equal(Reflect.getPrototypeOf([]), Array.prototype);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/reflect.getprototypeof\n[npm-version-svg]: https://versionbadg.es/es-shims/Reflect.getPrototypeOf.svg\n[deps-svg]: https://david-dm.org/es-shims/Reflect.getPrototypeOf.svg\n[deps-url]: https://david-dm.org/es-shims/Reflect.getPrototypeOf\n[dev-deps-svg]: https://david-dm.org/es-shims/Reflect.getPrototypeOf/dev-status.svg\n[dev-deps-url]: https://david-dm.org/es-shims/Reflect.getPrototypeOf#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/reflect.getprototypeof.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/reflect.getprototypeof.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/reflect.getprototypeof.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=reflect.getprototypeof\n[codecov-image]: https://codecov.io/gh/es-shims/Reflect.getPrototypeOf/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/es-shims/Reflect.getPrototypeOf/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Reflect.getPrototypeOf\n[actions-url]: https://github.com/es-shims/Reflect.getPrototypeOf/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Freflect.getprototypeof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fes-shims%2Freflect.getprototypeof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fes-shims%2Freflect.getprototypeof/lists"}