Skip to content

shuhei/babel-plugin-type-assertion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-type-assertion

An babel transformer plugin for rtts_assert, a run-time type assertion library for JavaScript.

  • Inject runtime type assertions based on flow types.
  • Can be turned off on production build. (Just exclude from babel's plugins option.)

Installation

npm install -S rtts_assert babel-core babel-plugin-type-assertion

Usage

You need to transpile also rtts_assert's ES6 code.

Require hook:

require('babel-core/register')({
  ignore: /node_modules\/(?!rtts_assert)/,
  plugins: ['type-assertion']
});

require('your-module');

Webpack:

Working example config file

About

An experimental babel transformer plugin for rtts_assert

Resources

Stars

Watchers

Forks

Packages

No packages published