{"id":15685127,"url":"https://github.com/ljharb/find-value-locations","last_synced_at":"2025-05-09T00:53:58.697Z","repository":{"id":54878229,"uuid":"38085035","full_name":"ljharb/find-value-locations","owner":"ljharb","description":"Given an object, and a value, return a tuple of the property name, and the object on which it is an own property.","archived":false,"fork":false,"pushed_at":"2024-12-29T07:48:27.000Z","size":148,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-09T00:53:52.895Z","etag":null,"topics":["find","javascript","locations","property","prototype","value"],"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/ljharb.png","metadata":{"funding":{"github":["ljharb"],"patreon":null,"open_collective":null,"ko_fi":"ljharb","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":"ljharb","custom":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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}},"created_at":"2015-06-26T01:59:35.000Z","updated_at":"2025-02-06T20:18:22.000Z","dependencies_parsed_at":"2024-06-11T18:21:29.392Z","dependency_job_id":"1d291b04-0bef-4fc8-aa5b-ed21a09d38d2","html_url":"https://github.com/ljharb/find-value-locations","commit_stats":{"total_commits":134,"total_committers":1,"mean_commits":134.0,"dds":0.0,"last_synced_commit":"55ebae791d3fc4bd62b9493427fbc5e543220d43"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Ffind-value-locations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Ffind-value-locations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Ffind-value-locations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ljharb%2Ffind-value-locations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ljharb","download_url":"https://codeload.github.com/ljharb/find-value-locations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171236,"owners_count":21865289,"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":["find","javascript","locations","property","prototype","value"],"created_at":"2024-10-03T17:23:45.186Z","updated_at":"2025-05-09T00:53:58.676Z","avatar_url":"https://github.com/ljharb.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ljharb","https://ko-fi.com/ljharb","https://thanks.dev/ljharb"],"categories":[],"sub_categories":[],"readme":"# find-value-locations \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[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][npm-badge-png]][package-url]\n\nGiven an object, and a value, return a tuple of the property name, the object on which it is an own property, and the property descriptor.\n\nWorks with string keys, Symbol keys, both enumerable and non-enumerable keys, and crawls up the prototype chain to find the exact object it's located on.\n\n## Example\n\n```js\nvar findValue = require('find-value-locations');\nvar assert = require('assert');\n\nvar value = {};\n\nfunction Foo() {}\nfunction Bar() {}\nfunction Baz() {}\n\nObject.prototype.property = value;\nFunction.prototype.property = value;\n\nBar.prototype = Baz;\n\nFoo.prototype = new Bar();\nFoo.prototype.property = value;\nvar symbol = Symbol('a symbol property');\nFoo.prototype[symbol] = value;\n\nvar tuples = findValue(new Foo(), value);\n\nassert.deepEqual(tuples, [\n\t[Foo.prototype, 'property', Object.getOwnPropertyDescriptor(Foo.prototype, 'property')],\n\t[Foo.prototype, symbol, Object.getOwnPropertyDescriptor(Foo.prototype, symbol)],\n\t[Function.prototype, 'property', Object.getOwnPropertyDescriptor(Function.prototype, 'property')],\n\t[Object.prototype, 'property', Object.getOwnPropertyDescriptor(Object.prototype, 'property')]\n]);\n```\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[package-url]: https://npmjs.org/package/find-value-locations\n[npm-version-svg]: https://versionbadg.es/ljharb/find-value-locations.svg\n[deps-svg]: https://david-dm.org/ljharb/find-value-locations.svg\n[deps-url]: https://david-dm.org/ljharb/find-value-locations\n[dev-deps-svg]: https://david-dm.org/ljharb/find-value-locations/dev-status.svg\n[dev-deps-url]: https://david-dm.org/ljharb/find-value-locations#info=devDependencies\n[npm-badge-png]: https://nodei.co/npm/find-value-locations.png?downloads=true\u0026stars=true\n[license-image]: https://img.shields.io/npm/l/find-value-locations.svg\n[license-url]: LICENSE\n[downloads-image]: https://img.shields.io/npm/dm/find-value-locations.svg\n[downloads-url]: https://npm-stat.com/charts.html?package=find-value-locations\n[codecov-image]: https://codecov.io/gh/ljharb/find-value-locations/branch/main/graphs/badge.svg\n[codecov-url]: https://app.codecov.io/gh/ljharb/find-value-locations/\n[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/find-value-locations\n[actions-url]: https://github.com/ljharb/find-value-locations/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Ffind-value-locations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fljharb%2Ffind-value-locations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fljharb%2Ffind-value-locations/lists"}