{"id":26189990,"url":"https://github.com/react-earth/object-standard-path","last_synced_at":"2025-04-15T02:09:24.231Z","repository":{"id":168913164,"uuid":"644343485","full_name":"react-earth/object-standard-path","owner":"react-earth","description":"Typed get/set deep nested properties with standard path.","archived":false,"fork":false,"pushed_at":"2024-09-07T06:19:19.000Z","size":1665,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T03:35:17.853Z","etag":null,"topics":["access","array","change","deep","dot","get","nested","notation","object","path","property","set","standard","type","typescript","update","value"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/react-earth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-05-23T10:19:37.000Z","updated_at":"2024-09-07T06:19:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"4f496e53-cd53-4ae0-b40b-566d0aacd8ca","html_url":"https://github.com/react-earth/object-standard-path","commit_stats":null,"previous_names":["react-earth/object-standard-path"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-earth%2Fobject-standard-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-earth%2Fobject-standard-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-earth%2Fobject-standard-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-earth%2Fobject-standard-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-earth","download_url":"https://codeload.github.com/react-earth/object-standard-path/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647301,"owners_count":21139086,"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":["access","array","change","deep","dot","get","nested","notation","object","path","property","set","standard","type","typescript","update","value"],"created_at":"2025-03-12T00:52:09.304Z","updated_at":"2025-04-15T02:09:24.214Z","avatar_url":"https://github.com/react-earth.png","language":"TypeScript","readme":"![title](media/repo-header.svg)\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/react-earth/object-standard-path\" target=\"\\_parent\"\u003e\u003cimg alt=\"star\" src=\"https://img.shields.io/github/stars/react-earth/object-standard-path.svg?style=social\u0026label=Star\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/object-standard-path\" target=\"\\_parent\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/object-standard-path\" alt=\"version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/object-standard-path\" target=\"\\_parent\"\u003e\u003cimg alt=\"minzip\" src=\"https://img.badgesize.io/https:/unpkg.com/object-standard-path@latest/dist/index.esm.js?compression=gzip\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/object-standard-path\" target=\"\\_parent\"\u003e\u003cimg alt=\"downloads\" src=\"https://img.shields.io/npm/dm/object-standard-path.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/react-earth/object-standard-path\" target=\"\\_parent\"\u003e\u003cimg alt=\"license\" src=\"https://img.shields.io/npm/l/object-standard-path\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Quick Features 🥳\n\n- Standard path, e.g. `a.b.c[0].d`.\n- Provider types \u0026 utils: Path, PathValue, pathGet, pathSet, pathSetImmutable.\n- Built with typescript, provide type protection, code autocompletion, make your app robust.\n- No dependencies, less than 1kB page size.\n\n## How to use 📖\n\n### Install package\n\n```shell\nnpm install object-standard-path\n```\n\n### Use types: Path, PathValue\n\n```typescript\nimport { Path, PathValue } from 'object-standard-path';\n\ntype Test = {\n  value: string;\n  array: {\n    value: string;\n  }[];\n};\n\ntype TestPath = Path\u003cTest\u003e;\n// result: \"value\" | \"array\" | `array[${number}]` | `array[${number}].value`\n\ntype TestPathValue = PathValue\u003cTest, 'array[0]'\u003e;\n// result: { value: string }\n```\n\n### Use utils: pathGet, pathSet, pathSetImmutable\n\n```typescript\nimport { pathGet, pathSet, pathSetImmutable } from 'object-standard-path';\n\nconst object = {\n  array: [\n    {\n      value: 1,\n    },\n  ],\n};\n\nconst result = pathGet(object, 'array[0].value');\n// result: 1\n\npathSet(object, 'array[0].value', 2);\n// object: { array: [{ value: 2 }] }\n\nconst result = pathSetImmutable(object, 'array[0].value', 2);\n// result: { array: [{ value: 2 }] }\n```\n\n**Notes: please don't include the characters `.[]` in the key of the object, as they may affect parsing.**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-earth%2Fobject-standard-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-earth%2Fobject-standard-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-earth%2Fobject-standard-path/lists"}