Nourished Personal Mucus

npm

Need private packages and team management tools?Check out npm Orgs. »

babel-plugin-flow-prepack

0.13.0 • Public • Published

Babel Plugin Flow Prepack

A babel plugin which transforms Flow annotations into prepack model declarations.

What?

Turns code like this:

 
type Status = string;
 
declare var someGlobal: {
  foo: number,
  bar: string,
  status: Status
};
 

Into code like this:

const Status = 'string';
__assumeDataProperty(global, 'someGlobal', __abstract({
  foo: __abstract('number'),
  bar: __abstract('string'),
  status: __abstract(Status)
}))

So that you can use Flow type annotations to give type hints to prepack.

Installation

npm install --save-dev babel-plugin-flow-prepack

Next, add the following to your babel configuration or .babelrc:

{
  "plugins": ["flow-prepack"]
}

Keywords

none

install

npm i babel-plugin-flow-prepack

Downloadsweekly downloads

4

version

0.13.0

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability