Skip to main content

@babel/plugin-syntax-partial-application

note

Syntax only​

It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-proposal-partial-application to both parse and transform this syntax.

Installation​

npm install --save-dev @babel/plugin-syntax-partial-application

Usage​

babel.config.json
{
"plugins": [
["@babel/plugin-syntax-partial-application", { "version": "2018-07" }]
]
}

Via Node API​

JavaScript
require("@babel/core").transformSync("code", {
plugins: [
["@babel/plugin-syntax-partial-application", { version: "2018-07" }]
]
});

Options​

History
VersionChanges
v8.1.0Added support for "2021-10"
v8.0.0Added the version option with support for "2018-07"

version (required)​

  • "2018-07" is the proposal version after the updates that was discussed in the July 2018 TC39 meeting.
    const addOne = add(1, ?);
  • "2021-10" is the proposal version after the updates in October 2021. A partial application is marked with ~, and supports ordinal placeholders (?0) and a rest placeholder (...).
    const addOne = add~(1, ?);
    const flip = f~(?1, ?0);
    const bound = f~(a, ...);
    const make = new Point~(?, 0);