{"id":20906173,"url":"https://github.com/distributedlife/ok-selector","last_synced_at":"2026-04-29T04:03:59.906Z","repository":{"id":141572175,"uuid":"67410201","full_name":"distributedlife/ok-selector","owner":"distributedlife","description":"Pluck values from an object using selector strings.","archived":false,"fork":false,"pushed_at":"2017-07-04T07:18:33.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T14:24:04.243Z","etag":null,"topics":["selector"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/distributedlife.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-09-05T10:06:55.000Z","updated_at":"2017-07-03T23:23:53.000Z","dependencies_parsed_at":"2024-07-09T18:35:48.227Z","dependency_job_id":null,"html_url":"https://github.com/distributedlife/ok-selector","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributedlife%2Fok-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributedlife%2Fok-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributedlife%2Fok-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/distributedlife%2Fok-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/distributedlife","download_url":"https://codeload.github.com/distributedlife/ok-selector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243297714,"owners_count":20268827,"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":["selector"],"created_at":"2024-11-18T13:29:20.273Z","updated_at":"2025-12-29T04:10:01.734Z","avatar_url":"https://github.com/distributedlife.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ok-selector\nA small library for plucking values out of objects, both native and immutable.\n\n## native\nGiven the following state:\n\n```javascript\nconst state = {\n  level1: {\n    level2: {\n      level3: {\n        value: 'yes'\n      }\n    }\n  },\n  array: [\n    {id: 1, value: 2},\n    {id: 2, value: 4},\n    {id: 3, value: 6},\n    {id: 4, value: 8},\n  ]\n};\n```\n\nThese tests hold true\n\n```javascript\nit('should support dot.strings', () =\u003e {\n  expect(read(state, 'level1.level2.level3.value')).to.equal('yes');\n  expect(read(state, 'level1.level2.level3')).to.deep.equal({value: 'yes'});\n  expect(read(state, 'array')).to.deep.equal([\n    {id: 1, value: 2},\n    {id: 2, value: 4},\n    {id: 3, value: 6},\n    {id: 4, value: 8},\n  ]);\n});\n\nit('should support addressing arrays by id', () =\u003e {\n  expect(read(state, 'array:3')).to.deep.equal({id: 3, value: 6});\n  expect(read(state, 'array:3.value')).to.deep.equal(6);\n});\n\nit('should support plucking all values from an array', () =\u003e {\n  expect(read(state, 'array*.value')).to.deep.equal([2, 4, 6, 8]);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributedlife%2Fok-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistributedlife%2Fok-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributedlife%2Fok-selector/lists"}