Skip to content

A babel-macro to transpile `Object.assign`-style expressions to direct assignments for maximum performance.

License

Notifications You must be signed in to change notification settings

vincentriemer/assign.macro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

assign.macro Babel Macro

A babel-macro to transpile Object.assign-style expressions to direct assignments for maximum performance.

Installation

This module is distributed in the npm registry under assign.macro which should be installed to your project's devDependencies:

npm install --save-dev assign.macro

# or if you use yarn
yarn add --dev assign.macro

Usage

After you have configured babel-macros you can import assign.macro and utilize it like so:

import assign from "assign.macro";

const test = {};
assign(test, {
  babel: "macros",
  are: "dope"
});

...which will be transpiled to the following:

const test = {};
test.babel = "macros";
test.are = "dope";

About

A babel-macro to transpile `Object.assign`-style expressions to direct assignments for maximum performance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published