{"id":21186043,"url":"https://github.com/codemodsquad/function-codemorphs","last_synced_at":"2026-04-25T08:31:32.680Z","repository":{"id":40783752,"uuid":"237568762","full_name":"codemodsquad/function-codemorphs","owner":"codemodsquad","description":"codemods for in-IDE refactoring of functions","archived":false,"fork":false,"pushed_at":"2023-01-05T06:12:00.000Z","size":3525,"stargazers_count":1,"open_issues_count":21,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T09:40:42.115Z","etag":null,"topics":["jscodeshift","refactoring"],"latest_commit_sha":null,"homepage":null,"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/codemodsquad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-01T05:43:56.000Z","updated_at":"2021-05-26T06:59:45.000Z","dependencies_parsed_at":"2023-02-03T15:02:05.203Z","dependency_job_id":null,"html_url":"https://github.com/codemodsquad/function-codemorphs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemodsquad%2Ffunction-codemorphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemodsquad%2Ffunction-codemorphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemodsquad%2Ffunction-codemorphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemodsquad%2Ffunction-codemorphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemodsquad","download_url":"https://codeload.github.com/codemodsquad/function-codemorphs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639556,"owners_count":20323510,"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":["jscodeshift","refactoring"],"created_at":"2024-11-20T18:21:06.739Z","updated_at":"2025-12-30T11:25:07.720Z","avatar_url":"https://github.com/codemodsquad.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# function-codemorphs\n\n[![CircleCI](https://circleci.com/gh/codemodsquad/function-codemorphs.svg?style=svg)](https://circleci.com/gh/codemodsquad/function-codemorphs)\n[![Coverage Status](https://codecov.io/gh/codemodsquad/function-codemorphs/branch/master/graph/badge.svg)](https://codecov.io/gh/codemodsquad/function-codemorphs)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm version](https://badge.fury.io/js/function-codemorphs.svg)](https://badge.fury.io/js/function-codemorphs)\n\ncodemods for in-IDE refactoring of functions\n\nThese aren't really intended to be used with the `jscodeshift` CLI, but rather for building IDE extensions.\n\n# `convertArrowFunctionBodyToBlockStatement`\n\nConverts an arrow function with an expression body to a block statement.\n\n## Before\n\n```js\nconst foo = () =\u003e 'foo!'\n```\n\n## After\n\n```js\nconst foo = () =\u003e {\n  return 'foo!'\n}\n```\n\n## Special Options\n\n### `selectionStart` (`number`, **required**)\n\nThe start of the selection in the source code. This is used for determining which function to convert.\n\n### `selectionEnd` (`number`, **required**)\n\nThe end of the selection in the source code. This is used for determining which function to convert.\n\n# `convertArrowFunctionBodyToExpression`\n\nConverts the block statement body of an arrow function to an expression, as long as the body only\nconsists of a return statement.\n\n## Before\n\n```js\nconst foo = () =\u003e {\n  return 'foo!'\n}\n```\n\n## After\n\n```js\nconst foo = () =\u003e 'foo!'\n```\n\n## Special Options\n\n### `selectionStart` (`number`, **required**)\n\nThe start of the selection in the source code. This is used for determining which function to convert.\n\n### `selectionEnd` (`number`, **required**)\n\nThe end of the selection in the source code. This is used for determining which function to convert.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemodsquad%2Ffunction-codemorphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemodsquad%2Ffunction-codemorphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemodsquad%2Ffunction-codemorphs/lists"}