Socket
Socket
Sign inDemoInstall

json-schema-to-flow-type

Package Overview
Dependencies
Maintainers
1
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 - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

4

lib/FlowSchema.js

@@ -123,2 +123,6 @@ 'use strict';

if (isObject(schema) && isArray(schema)) {
return f.flowType('any');
}
if (isObject(schema)) {

@@ -125,0 +129,0 @@ return f.flowType('Object').props(_lodash2.default.mapValues(schema.properties, convertSchema), schema.required).union([..._lodash2.default.map(schema.patternProperties, convertSchema), typeof schema.additionalProperties === 'object' ? convertSchema(schema.additionalProperties) : undefined, typeof schema.additionalProperties === 'boolean' && schema.additionalProperties ? convertSchema({}) : undefined]);

2

lib/index.js

@@ -35,4 +35,4 @@ 'use strict';

const schemaToFlow = exports.schemaToFlow = flowSchema => (0, _babelGenerator2.default)(t.program([..._lodash2.default.map(flowSchema.$definitions, toFlow), toFlow(flowSchema)])).code;
const schemaToFlow = exports.schemaToFlow = flowSchema => _lodash2.default.map([..._lodash2.default.map(flowSchema.$definitions, toFlow), toFlow(flowSchema)], ast => (0, _babelGenerator2.default)(ast).code).join('\n\n');
const parseSchema = exports.parseSchema = (schema, imports) => _lodash2.default.flow(s => (0, _Schema.simplifySchema)(s, imports), _FlowSchema.convertSchema, schemaToFlow)(schema);
{
"name": "json-schema-to-flow-type",
"version": "0.2.2",
"version": "0.2.3",
"ava": {

@@ -5,0 +5,0 @@ "files": [

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