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.0 to 0.2.1

8

lib/FlowSchema.js

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

if (isObject(schema)) {
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]);
}
if (isArray(schema)) {

@@ -128,6 +132,2 @@ return f.flowType('Array').union(_lodash2.default.map([].concat(schema.items || {}), convertSchema));

if (isObject(schema)) {
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]);
}
switch (_lodash2.default.toLower(String(schema.type))) {

@@ -134,0 +134,0 @@ case 'string':

@@ -38,3 +38,3 @@ 'use strict';

if (flowSchema.$required) {
if (_lodash2.default.includes(flowSchema.$required, field)) {
return ast;

@@ -41,0 +41,0 @@ }

{
"name": "json-schema-to-flow-type",
"version": "0.2.0",
"version": "0.2.1",
"ava": {

@@ -15,3 +15,3 @@ "files": [

"lint": "eslint ./src --fix",
"test": "ava",
"test": "npm run lint && ava -v",
"build": "rm -rf lib && babel src --ignore __**__ -d lib",

@@ -23,3 +23,3 @@ "prepublish": "flow-typed update && npm test && npm run build"

"@morlay/eslint-config": "3.0.x",
"ava": "0.16.x",
"ava": "0.17.x",
"babel-cli": "6.18.x",

@@ -26,0 +26,0 @@ "babel-core": "6.18.x",

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