Socket
Socket
Sign inDemoInstall

babel-plugin-flow-prepack

Package Overview
Dependencies
33
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-flow-prepack

Transforms flow type annotations into prepack __assumeDataProperty() and __abstract() calls.


Version published
Weekly downloads
2
Maintainers
1
Install size
5.69 MB
Created
Weekly downloads
 

Readme

Source

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"]
}

FAQs

Last updated on 25 Jun 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc