{"id":1027195,"url":"https://github.com/cdlewis/idx-to-optional-chaining","last_synced_at":"2026-01-26T03:35:10.591Z","repository":{"id":43976166,"uuid":"166650693","full_name":"cdlewis/idx-to-optional-chaining","owner":"cdlewis","description":"JSCodeShift codemod that transforms usage of idx to the draft optional chaining standard.","archived":false,"fork":false,"pushed_at":"2023-01-05T10:15:19.000Z","size":982,"stargazers_count":19,"open_issues_count":11,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T14:32:34.086Z","etag":null,"topics":["codemod","flow","idx","javascript","jscodeshift","optional-chaining","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdlewis.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-20T10:52:50.000Z","updated_at":"2022-05-26T14:16:45.000Z","dependencies_parsed_at":"2023-02-04T00:31:10.109Z","dependency_job_id":null,"html_url":"https://github.com/cdlewis/idx-to-optional-chaining","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdlewis/idx-to-optional-chaining","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdlewis%2Fidx-to-optional-chaining","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdlewis%2Fidx-to-optional-chaining/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdlewis%2Fidx-to-optional-chaining/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdlewis%2Fidx-to-optional-chaining/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdlewis","download_url":"https://codeload.github.com/cdlewis/idx-to-optional-chaining/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdlewis%2Fidx-to-optional-chaining/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275182691,"owners_count":25419578,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["codemod","flow","idx","javascript","jscodeshift","optional-chaining","typescript"],"created_at":"2024-01-13T21:20:19.678Z","updated_at":"2026-01-26T03:35:10.585Z","avatar_url":"https://github.com/cdlewis.png","language":"JavaScript","funding_links":[],"categories":["ESNext"],"sub_categories":[],"readme":"# idx to optional chaining [![Build Status](https://travis-ci.com/cdlewis/idx-to-optional-chaining.svg?branch=master)](https://travis-ci.com/cdlewis/idx-to-optional-chaining)\n\nFacebook's [idx](https://github.com/facebookincubator/idx) was a useful helper prior to the [optional chaining](https://github.com/tc39/proposal-optional-chaining) maturing as a standard because it\nplayed nicely with Flow. But now optional chaining is stage 4 and has Flow/Typescript support. This codemod\nwill convert transform most usages of idx.\n\n## Usage\n\n```console\nfoo@bar:~$ git clone git@github.com:cdlewis/idx-to-optional-chaining.git\nfoo@bar:~$ npm install -g jscodeshift\nfoo@bar:~$ jscodeshift -t idx-to-optional-chaining/index.js file-to-transform.js\n```\n\n## Example\n\nBefore:\n\n```js\nimport idx from \"idx\";\n\nlet a = idx(a, _ =\u003e _.b);\nlet b = idx(a, _ =\u003e _.b.c);\nlet c = idx(a, _ =\u003e _.b.c.d);\nlet d = idx(a, _ =\u003e _[0][1][2]);\nlet e = idx(a, _ =\u003e _.b[0].c[variable]);\n```\n\nAfter:\n\n```js\nlet a = a?.b\nlet b = a?.b?.c\nlet c = a?.b?.c?.d\nlet d = a?.0?.[1]?.[2]\nlet e = a?.b?.[0]?.c?.[variable]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdlewis%2Fidx-to-optional-chaining","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdlewis%2Fidx-to-optional-chaining","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdlewis%2Fidx-to-optional-chaining/lists"}