{"id":16731433,"url":"https://github.com/skratchdot/object-path-set","last_synced_at":"2025-07-18T01:10:03.316Z","repository":{"id":20789265,"uuid":"24074384","full_name":"skratchdot/object-path-set","owner":"skratchdot","description":"set values in javascript objects by specifying a path","archived":false,"fork":false,"pushed_at":"2023-03-04T02:34:42.000Z","size":1488,"stargazers_count":5,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T05:23:06.003Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","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":"2014-09-15T21:20:52.000Z","updated_at":"2023-03-07T04:03:58.000Z","dependencies_parsed_at":"2024-06-19T00:06:39.775Z","dependency_job_id":"a9b36b99-b130-400b-8bbb-1b5734dab840","html_url":"https://github.com/skratchdot/object-path-set","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fobject-path-set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fobject-path-set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fobject-path-set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fobject-path-set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/object-path-set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874169,"owners_count":20524576,"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-10-12T23:37:12.626Z","updated_at":"2025-03-21T21:31:17.576Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# object-path-set\n\n[![NPM version](https://badge.fury.io/js/object-path-set.svg)](http://badge.fury.io/js/object-path-set)\n[![Build Status](https://travis-ci.org/skratchdot/object-path-set.png?branch=master)](https://travis-ci.org/skratchdot/object-path-set)\n[![Code Climate](https://codeclimate.com/github/skratchdot/object-path-set.png)](https://codeclimate.com/github/skratchdot/object-path-set)\n[![Coverage Status](https://coveralls.io/repos/skratchdot/object-path-set/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/skratchdot/object-path-set?branch=master)\n[![Dependency Status](https://david-dm.org/skratchdot/object-path-set.svg)](https://david-dm.org/skratchdot/object-path-set)\n[![devDependency Status](https://david-dm.org/skratchdot/object-path-set/dev-status.svg)](https://david-dm.org/skratchdot/object-path-set#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/object-path-set.png)](https://npmjs.org/package/object-path-set)\n\n## Description\n\nset values in javascript objects by specifying a path.\n\nif the path doesn't exist yet, it will be created.\n\nby using this library, you can help prevent the following error from occurring:\n\n```\nCannot set property 'foo' of undefined\n```\n\nNOTE: I've re-written / used this function so many different times, I decided to publish it\nas a module.\n\n## Getting Started\n\nInstall the module with: `npm install --save object-path-set`\n\n```javascript\nvar setPath = require('object-path-set');\nvar obj = { foo: { bar: 'baz' } };\nobj = setPath(obj, 'foo.bar', 'newValue'); // result: {foo:{bar:'newValue'}}\nobj = setPath(obj, 'foo.invalidKey', 'cool'); // result: {foo:{bar:'newValue',invalidKey: 'cool'}}\nobj = setPath(obj, 'foo|bar', 'again', '|'); // result: {foo:{bar:'again',invalidKey: 'cool'}}\n```\n\n## Links\n\n- [Source Code](https://github.com/skratchdot/object-path-set)\n- [Changelog](https://github.com/skratchdot/object-path-set/blob/master/CHANGELOG.md)\n- [Live example on Runkit](https://npm.runkit.com/object-path-set)\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\n\u003c!-- prettier-ignore --\u003e\n| [\u003cimg src=\"https://avatars1.githubusercontent.com/u/434470?v=4\" width=\"100px;\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e◬\u003c/b\u003e\u003c/sub\u003e](https://www.skratchdot.com/)\u003cbr /\u003e[💻](https://github.com/skratchdot/object-path-set/commits?author=skratchdot \"Code\") [📖](https://github.com/skratchdot/object-path-set/commits?author=skratchdot \"Documentation\") |\n| :---: |\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nCopyright (c) 2014 skratchdot  \nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fobject-path-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fobject-path-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fobject-path-set/lists"}