{"id":21574047,"url":"https://github.com/ln613/ipath","last_synced_at":"2025-07-20T17:33:41.518Z","repository":{"id":27564265,"uuid":"114426601","full_name":"ln613/ipath","owner":"ln613","description":"Ensure immutability by updating javascript objects using a path similar to CSS/jQuery selector, great for react/redux applications where immutability is required, especially when working with deeply nested objects.","archived":false,"fork":false,"pushed_at":"2023-01-04T12:06:05.000Z","size":843,"stargazers_count":1,"open_issues_count":15,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T20:53:37.097Z","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/ln613.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}},"created_at":"2017-12-16T02:10:31.000Z","updated_at":"2020-06-01T23:17:49.000Z","dependencies_parsed_at":"2023-01-14T07:01:24.846Z","dependency_job_id":null,"html_url":"https://github.com/ln613/ipath","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ln613/ipath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fipath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fipath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fipath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fipath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ln613","download_url":"https://codeload.github.com/ln613/ipath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ln613%2Fipath/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266165975,"owners_count":23886706,"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-11-24T12:08:32.390Z","updated_at":"2025-07-20T17:33:41.501Z","avatar_url":"https://github.com/ln613.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipath\n\n[![Build Status](https://travis-ci.org/ln613/ipath.svg?branch=master)](https://travis-ci.org/ln613/ipath)\n\nEnsure immutability by updating javascript objects using a path similar to CSS/jQuery selector, great for react/redux applications where immutability is required, especially when working with deeply nested objects.\n\n[documetation](https://ln613.gitbooks.io/ipath/)\n\n## Install\n\n`npm i -S ipath`\n\n## Usage\n\n```js\nimport { update } from 'ipath';\n\nconst obj = {\n  artists: [\n    {\n      id: 3,\n      name: 'A1',\n      albums: [\n        { id: 1, name: 'a1', year: 1990 },\n        { id: 2, name: 'a2', year: 1995 },\n      ]\n    }\n  ]\n};\n\nlet newObj = update(obj, 'artists[id=3].albums[name=a2].year', 1992);\n// obj doesn't change, newObj.artists[0].albums[1].year = 1992\n\nlet newAlbum = { id: 3, name: 'a3', year: 2000 }\nnewObj = update(obj, 'artists[0].albums[]', newAlbum);\n// add newAlbum to the albums list\n\nnewObj = update(obj, 'artists[id=3].albums[name=a2]', null);\n// delete an item from array\n\nnewObj = update({ a: { b: 1 } }, 'a.b', x =\u003e x + 1);\n// calculate the new value based on the existing value\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fln613%2Fipath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fln613%2Fipath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fln613%2Fipath/lists"}