{"id":50926066,"url":"https://github.com/leodevbro/sort-to-tosorted","last_synced_at":"2026-06-16T23:03:17.151Z","repository":{"id":360163273,"uuid":"1248931879","full_name":"leodevbro/sort-to-tosorted","owner":"leodevbro","description":"Codemod to convert `[...array].sort()` into `array.toSorted()` (ES2023)","archived":false,"fork":false,"pushed_at":"2026-05-25T09:09:56.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-25T10:19:29.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/leodevbro.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-25T07:25:42.000Z","updated_at":"2026-05-25T09:10:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leodevbro/sort-to-tosorted","commit_stats":null,"previous_names":["leodevbro/sort-to-tosorted"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leodevbro/sort-to-tosorted","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodevbro%2Fsort-to-tosorted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodevbro%2Fsort-to-tosorted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodevbro%2Fsort-to-tosorted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodevbro%2Fsort-to-tosorted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leodevbro","download_url":"https://codeload.github.com/leodevbro/sort-to-tosorted/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leodevbro%2Fsort-to-tosorted/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34426745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-16T02:00:06.860Z","response_time":126,"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":[],"created_at":"2026-06-16T23:03:16.504Z","updated_at":"2026-06-16T23:03:17.143Z","avatar_url":"https://github.com/leodevbro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sort-to-tosorted\r\n\r\nCodemod to convert `[...array].sort()` into `array.toSorted()` (ES2023)\r\n\r\n## Run the script directly from the Codemod Registry\r\n\r\n```bash\r\nnpx codemod@latest sort-to-tosorted\r\n```\r\n\r\n\r\n## Examples\r\n\r\nBefore:\r\n```ts\r\nconst a = [...items].sort();\r\nconst b = [...getItems()].sort((x, y) =\u003e x - y);\r\nconst c = [...arr].sort(compareFn);\r\nconst keep = [...a, b].sort();\r\nconst keep2 = items.sort();\r\n\r\n```\r\n\r\nAfter:\r\n```ts\r\nconst a = items.toSorted();\r\nconst b = getItems().toSorted((x, y) =\u003e x - y);\r\nconst c = arr.toSorted(compareFn);\r\nconst keep = [...a, b].sort();\r\nconst keep2 = items.sort();\r\n```\r\n\r\n## Installation\r\n\r\n```bash\r\n# Install from registry\r\ncodemod run sort-to-tosorted\r\n\r\n# Or run locally\r\ncodemod run -w workflow.yaml\r\n```\r\n\r\n## Usage\r\n\r\nDocument the exact migration this codemod performs before publishing. At minimum, cover:\r\n\r\n- The concrete syntax or API patterns it rewrites\r\n- The file types or paths it targets\r\n- Important preserve/no-op cases and exclusions\r\n\r\n## Development\r\n\r\n```bash\r\n# Test the transformation\r\nnpm test\r\n\r\n# Validate the workflow\r\ncodemod workflow validate -w workflow.yaml\r\n\r\n# Publish to registry\r\ncodemod login\r\ncodemod publish\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodevbro%2Fsort-to-tosorted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleodevbro%2Fsort-to-tosorted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleodevbro%2Fsort-to-tosorted/lists"}