leaf-converter
Advanced tools
Comparing version 1.9.3 to 1.9.4
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.9.4"></a> | ||
## [1.9.4](https://github.com/forsigner/leaf-converter/compare/v1.9.3...v1.9.4) (2018-02-02) | ||
### Bug Fixes | ||
* fix array bug when object-to-schema ([d58fbc4](https://github.com/forsigner/leaf-converter/commit/d58fbc4)) | ||
<a name="1.9.3"></a> | ||
@@ -7,0 +17,0 @@ ## [1.9.3](https://github.com/forsigner/leaf-converter/compare/v1.9.2...v1.9.3) (2018-02-01) |
@@ -28,4 +28,4 @@ 'use strict'; | ||
return _.isArray(data) && !data.length; | ||
}, function () { | ||
return { type: 'array' }; | ||
}, function (value) { | ||
return value; | ||
}], [_.isArray, function (items) { | ||
@@ -59,3 +59,10 @@ return { type: 'array', items: objectToSchema(items[0]) }; | ||
if (_.isPlainObject(object[item])) { | ||
if (_.isArray(object[item]) && !object[item].length) { | ||
obj[item] = { | ||
type: 'array' | ||
}; | ||
return 'continue'; | ||
} | ||
if (_.isPlainObject(object[item]) || _.isArray(object[item])) { | ||
obj[item] = makeSchema(object[item]); | ||
@@ -79,2 +86,3 @@ return 'continue'; | ||
} | ||
obj[item] = makeSchema(value); | ||
@@ -81,0 +89,0 @@ return 'break'; |
{ | ||
"name": "leaf-converter", | ||
"description": "", | ||
"version": "1.9.3", | ||
"version": "1.9.4", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
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
36263
870