Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@babel/helper-optimise-call-expression
Advanced tools
@babel/helper-optimise-call-expression is a utility package within the Babel ecosystem designed to optimize call expressions in JavaScript code. It helps in transforming and optimizing function calls to improve performance and efficiency during the code compilation process.
Optimize Call Expressions
This feature optimizes a call expression by transforming the function call to a more efficient form. The code sample demonstrates how to use the `optimiseCallExpression` function to optimize a call to `myFunction` with arguments `1` and `2`.
const { default: optimiseCallExpression } = require('@babel/helper-optimise-call-expression');
const t = require('@babel/types');
const callee = t.identifier('myFunction');
const args = [t.numericLiteral(1), t.numericLiteral(2)];
const optimizedCall = optimiseCallExpression(callee, null, args);
console.log(optimizedCall);
This Babel plugin optimizes consecutive addition operations by transforming them into a single addition operation. It is similar to @babel/helper-optimise-call-expression in that it aims to optimize specific patterns in the code for better performance.
This plugin removes dead code from the JavaScript bundle, which can lead to performance improvements. While it focuses on eliminating unused code rather than optimizing call expressions, it shares the goal of improving the efficiency of the compiled code.
Helper function to optimise call expression
See our website @babel/helper-optimise-call-expression for more information.
Using npm:
npm install --save-dev @babel/helper-optimise-call-expression
or using yarn:
yarn add @babel/helper-optimise-call-expression --dev
v7.16.0 (2021-10-30)
babel-helpers
, babel-plugin-proposal-async-generator-functions
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
for-await
(@nicolo-ribaudo)babel-generator
, babel-parser
, babel-plugin-transform-typescript
, babel-types
babel-parser
babel-helper-fixtures
, babel-helper-transform-fixture-test-runner
, babel-parser
, babel-plugin-syntax-typescript
, babel-preset-typescript
.mts
and .cts
files in @babel/preset-typescript
(@nicolo-ribaudo)@babel/eslint-parser
(@nicolo-ribaudo)babel-generator
, babel-parser
, babel-plugin-proposal-pipeline-operator
, babel-plugin-syntax-pipeline-operator
babel-compat-data
, babel-generator
, babel-parser
, babel-preset-env
, babel-types
babel-helper-skip-transparent-expression-wrappers
, babel-plugin-proposal-optional-chaining
skipTransparentExprWrapperNodes
helper (@lightmare)babel-traverse
, babel-types
babel-parser
, babel-plugin-transform-typescript
babel-plugin-transform-typescript
babel-core
, babel-helper-create-class-features-plugin
, babel-plugin-transform-typescript
babel-compat-data
, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression
, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining
, babel-plugin-transform-react-constant-elements
, babel-preset-env
, babel-traverse
babel-plugin-proposal-async-generator-functions
, babel-traverse
babel-traverse
, babel-types
babel-generator
workspace:^
to specify @babel/
dependencies (@nicolo-ribaudo)babel-helper-fixtures
, babel-plugin-proposal-class-properties
, babel-plugin-transform-runtime
, babel-preset-react
babel-types
createTypeAnnotationBasedOnTypeof
(babel-types) (@lightmare)babel-helpers
babel-core
, babel-plugin-transform-react-jsx-development
, babel-plugin-transform-react-jsx
, babel-types
babel-types
FAQs
Helper function to optimise call expression
We found that @babel/helper-optimise-call-expression demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.