babel-plugin-pre-calculate-number

pre calculate number expression

MIT License

Downloads
5
Stars
35

Babel-plugin-pre-calculate-number

Before:

const result = 1 + 2 + 3 + 4 + 5;
const area = Math.PI * 2 ** 2;
const oneDaySeconds = 60 * 60 * 24;
const minAge = Math.min(12, 18, 22);

setTimeout(function() {
  // do something
}, 1000 * 2);

After:

const result = 15;
const area = 12.566370614359172;
const oneDaySeconds = 86400;
const minAge = 12;

setTimeout(function() {
  // do something
}, 2000);

Contributors

Axetroy

License

The MIT License

Package Rankings
Top 15.44% on Npmjs.org
Badges
Extracted from project README
Build Status Coverage Status Dependency Prettier npm version