{"id":23545192,"url":"https://github.com/dgeibi/spo-gpo","last_synced_at":"2025-05-15T10:34:04.338Z","repository":{"id":57367725,"uuid":"135014467","full_name":"dgeibi/spo-gpo","owner":"dgeibi","description":null,"archived":false,"fork":false,"pushed_at":"2018-05-27T04:12:53.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T15:18:31.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgeibi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-27T04:06:03.000Z","updated_at":"2019-03-19T06:04:14.000Z","dependencies_parsed_at":"2022-08-23T20:10:52.258Z","dependency_job_id":null,"html_url":"https://github.com/dgeibi/spo-gpo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fspo-gpo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fspo-gpo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fspo-gpo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgeibi%2Fspo-gpo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgeibi","download_url":"https://codeload.github.com/dgeibi/spo-gpo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254322875,"owners_count":22051681,"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":[],"created_at":"2024-12-26T08:15:24.138Z","updated_at":"2025-05-15T10:34:04.300Z","avatar_url":"https://github.com/dgeibi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polyfill for `Object.setPrototypeOf` and `Object.getPrototypeOf`\n\n## Usage\n\n```\n$ npm install spo-gpo\n```\n\nAs a ponyfill:\n\n```js\nconst assert = require('assert');\nconst { setPrototypeOf, getPrototypeOf } = require('spo-gpo');\n\nconst obj = {};\nconst proto = {\n  foo: function() {\n    return 'bar';\n  }\n};\n\nassert(getPrototypeOf(obj) === Object.prototype);\n\nsetPrototypeOf(obj, proto);\n\nassert(obj.foo() === 'bar');\nassert(getPrototypeOf(obj) === proto);\n```\n\nGlobally, as a polyfill:\n\n```js\nrequire('spo-gpo/polyfill');\n\nconst proto = {\n  foo: function() {\n    return 'bar';\n  }\n};\n\nconst obj = Object.setPrototypeOf({}, proto);\n\nobj.foo(); // 'bar'\nObject.getPrototypeOf(obj); // proto\n```\n\n## Related projects\n\n* [wesleytodd/setprototypeof](https://github.com/wesleytodd/setprototypeof)\n* [paulmillr/es6-shim](https://github.com/paulmillr/es6-shim)\n* [zloirock/core-js](https://github.com/zloirock/core-js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgeibi%2Fspo-gpo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgeibi%2Fspo-gpo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgeibi%2Fspo-gpo/lists"}