{"id":19850543,"url":"https://github.com/joe-re/object-dig","last_synced_at":"2025-05-01T23:30:34.161Z","repository":{"id":57312534,"uuid":"50511991","full_name":"joe-re/object-dig","owner":"joe-re","description":"This allow you to use method like Ruby's hash#dig in JavaScript.","archived":false,"fork":false,"pushed_at":"2018-05-17T18:15:06.000Z","size":17,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-14T02:35:54.904Z","etag":null,"topics":["javascript"],"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/joe-re.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-27T14:14:14.000Z","updated_at":"2021-11-12T03:26:07.000Z","dependencies_parsed_at":"2022-09-06T21:21:02.830Z","dependency_job_id":null,"html_url":"https://github.com/joe-re/object-dig","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joe-re%2Fobject-dig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joe-re%2Fobject-dig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joe-re%2Fobject-dig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joe-re%2Fobject-dig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joe-re","download_url":"https://codeload.github.com/joe-re/object-dig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224280925,"owners_count":17285554,"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":["javascript"],"created_at":"2024-11-12T13:26:34.270Z","updated_at":"2024-11-12T13:26:35.286Z","avatar_url":"https://github.com/joe-re.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# object-dig\n\n[![Build Status](https://travis-ci.org/joe-re/object-dig.svg?branch=master)](https://travis-ci.org/joe-re/object-dig)\n\nThis allow you to use method like Ruby's hash#dig in JavaScript.\n\n\u003e http://ruby-doc.org/core-2.3.0_preview1/Hash.html#method-i-dig\n\u003e\u003e Retrieves the value object corresponding to the each key objects repeatedly.\n\n# Install\n\n```\n$ npm install --save object-dig\n```\n\n# Usage\n\n```js\nvar dig = require('object-dig');\n\nvar object = { a: { b: { c: 'c' } } };\n\ndig(object, 'a', 'b');\n// =\u003e { c: 'c' }\n\ndig(object, 'a', 'b', 'c');\n// =\u003e 'c'\n\ndig(object, 'a', 'unknownProp', 'c');\n// =\u003eundefined\n```\n\nand you can give function object to dig.\nFunction object's argument is result of just before evaluating.\n\n```js\ndig(object, 'a', 'b', 'c', (val) =\u003e `${val} was changed`);\n// =\u003e 'c was changed'\n\ndig(object, 'a', 'b', 'c', (val) =\u003e `${val} was changed`, (val) =\u003e `${val} more`);\n// =\u003e 'c was changed more'\n```\n\n# License\n\nMIT © [joe-re](https://github.com/joe-re)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoe-re%2Fobject-dig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoe-re%2Fobject-dig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoe-re%2Fobject-dig/lists"}