Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

babel-plugin-optimize-starts-with

Transform startsWith into raw char code tests

Example

In

if ('test'.startsWith('te')) {
  // true
}

Out

if ('test'.charCodeAt(0) === 116&& 'test'.charCodeAt(1) === 101) {
  // true
}

Installation

npm install --save-dev babel-plugin-optimize-starts-with

Usage

Via .babelrc (Recommended)

.babelrc

{
      "plugins": ["optimize-starts-with"]
}

Via CLI

babel --plugins optimize-starts-with script.js

Via Node API

require("babel-core").transform("code", {
      plugins: ["optimize-starts-with"]
});

About

Transform startsWith into raw char code tests

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.