Socket
Socket
Sign inDemoInstall

json-schema-to-flow-type

Package Overview
Dependencies
Maintainers
4
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-to-flow-type

[![Build Status](https://img.shields.io/travis/morlay/json-schema-to-flow-type.svg?style=flat-square)](https://travis-ci.org/morlay/json-schema-to-flow-type) [![NPM](https://img.shields.io/npm/v/json-schema-to-flow-type.svg?style=flat-square)](https://npm


Version published
Weekly downloads
304
increased by28.27%
Maintainers
4
Weekly downloads
 
Created
Source

Convert JSON Schema to Flow Type Definitions

Build Status NPM Dependencies License

APIs

type Imports = {
  [key: string]: Schema
}

simplifySchema(schema, Schema, imports: ?Imports): Schema

  • schema should have id for type alias identifier
  • outside $ref will be resolve the real schema instead of $ref;
  • imports with { #: schema } will have same rule as above;

convertSchema(schema: Schema): FlowSchema

convert schema to a flow schema

toFlow(flowSchema): AstObject

will export ast object export ${upperCamelCase(flowSchema.id)} == ${toFlowType(flowType)}

schemaToFlow(flowSchema): string

convert definitions and schema root by toFlow

parseSchema(schema: Schema, imports: ?Imports): string

pipe simplifySchema | convertSchema | schemaToFlow

Changelog

0.4.0

  • Support for string literal object type keys

0.3.0

FAQs

Package last updated on 19 Oct 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc