New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

function-codemorphs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-codemorphs

codemods for in-IDE refactoring of functions

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

function-codemorphs

CircleCI Coverage Status semantic-release Commitizen friendly npm version

codemods for in-IDE refactoring of functions

These aren't really intended to be used with the jscodeshift CLI, but rather for building IDE extensions.

convertArrowFunctionBodyToBlockStatement

Converts an arrow function with an expression body to a block statement.

Before

const foo = () => 'foo!'

After

const foo = () => {
  return 'foo!'
}

Special Options

selectionStart (number, required)

The start of the selection in the source code. This is used for determining which function to convert.

selectionEnd (number, required)

The end of the selection in the source code. This is used for determining which function to convert.

convertArrowFunctionBodyToExpression

Converts the block statement body of an arrow function to an expression, as long as the body only consists of a return statement.

Before

const foo = () => {
  return 'foo!'
}

After

const foo = () => 'foo!'

Special Options

selectionStart (number, required)

The start of the selection in the source code. This is used for determining which function to convert.

selectionEnd (number, required)

The end of the selection in the source code. This is used for determining which function to convert.

Keywords

codemods

FAQs

Package last updated on 12 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts