json-schema-to-flow-type
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -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]); |
@@ -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": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13638
226