{"id":22281672,"url":"https://github.com/strikeentco/set","last_synced_at":"2025-07-28T20:31:14.746Z","repository":{"id":42274197,"uuid":"125754593","full_name":"strikeentco/set","owner":"strikeentco","description":"Set nested values on an object using a dot path or custom separator","archived":false,"fork":false,"pushed_at":"2023-03-04T02:36:25.000Z","size":358,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T17:47:01.824Z","etag":null,"topics":["deep","dot","dot-path","dot-prop","fast","javascript","lodash","lodash-set","nested-value","nodejs","object","object-path","path","set","set-deep","small","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/strikeentco.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-18T18:20:45.000Z","updated_at":"2023-12-05T06:48:34.000Z","dependencies_parsed_at":"2024-06-19T00:25:23.278Z","dependency_job_id":"278664ad-92cf-4c42-9bc3-4746727b62ca","html_url":"https://github.com/strikeentco/set","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"b2f942c29652066e484436a8cb0032932f085e9a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strikeentco%2Fset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strikeentco","download_url":"https://codeload.github.com/strikeentco/set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227670752,"owners_count":17801877,"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":["deep","dot","dot-path","dot-prop","fast","javascript","lodash","lodash-set","nested-value","nodejs","object","object-path","path","set","set-deep","small","value"],"created_at":"2024-12-03T16:20:26.044Z","updated_at":"2024-12-03T16:20:26.702Z","avatar_url":"https://github.com/strikeentco.png","language":"JavaScript","readme":"set [![License](https://img.shields.io/npm/l/@strikeentco/set.svg)](https://github.com/strikeentco/set/blob/master/LICENSE)  [![npm](https://img.shields.io/npm/v/@strikeentco/set.svg)](https://www.npmjs.com/package/@strikeentco/set)\n==========\n[![Build Status](https://travis-ci.org/strikeentco/set.svg)](https://travis-ci.org/strikeentco/set)  [![node](https://img.shields.io/node/v/@strikeentco/set.svg)](https://www.npmjs.com/package/@strikeentco/set) [![Test Coverage](https://api.codeclimate.com/v1/badges/450e530044d31f690dc5/test_coverage)](https://codeclimate.com/github/strikeentco/set/test_coverage)\n\nOne of the smallest (*31 sloc*) and most effective implementations of setting a nested value on an object.\n\n# Usage\n\n```sh\n$ npm install @strikeentco/set --save\n```\n\n```javascript\nconst set = require('@strikeentco/set');\n\nset({ a: { b: 'c' } }, 'a.b', 'd');\n//=\u003e { a: { b: 'd' } }\n\nset({ a: { b: ['c', 'd'] } }, 'a.b.1', 'e');\n//=\u003e { a: { b: ['c', 'e'] } }\n\nset({ a: { b: ['c', 'd'] } }, ['a', 'b'], 'c');\n//=\u003e { a: { b: 'c' } }\n\nset({ a: { b: 'c' } }, 'a.b.c.d', 'e');\n//=\u003e { a: { b: { c: { d: 'e' } } } }\n\nset({ a: { b: 'c' } }, 'a:b', 'd', ':');\n//=\u003e { a: { b: 'd' } }\n```\n## API\n\n### set(obj, path, val, [separator])\n\n#### Params:\n* **obj** (*Object*) - Source object.\n* **path** (*String|Array*) - String or array with path.\n* **val** (*Any*) - Value to set.\n* **[separator]** (*String*) - `.` by default.\n\n## License\n\nThe MIT License (MIT)\u003cbr/\u003e\nCopyright (c) 2018-present Alexey Bystrov\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrikeentco%2Fset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrikeentco%2Fset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrikeentco%2Fset/lists"}