Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaf-converter

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaf-converter - npm Package Compare versions

Comparing version 1.9.3 to 1.9.4

10

CHANGELOG.md

@@ -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)

14

lib/object-to-schema/json.js

@@ -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": {

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