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.4.3 to 1.5.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="1.5.0"></a>
# [1.5.0](https://github.com/forsigner/leaf-converter/compare/v1.4.3...v1.5.0) (2018-01-17)
### Features
* set default for structToSchema ([116cfda](https://github.com/forsigner/leaf-converter/commit/116cfda))
<a name="1.4.3"></a>

@@ -7,0 +17,0 @@ ## [1.4.3](https://github.com/forsigner/leaf-converter/compare/v1.4.2...v1.4.3) (2018-01-17)

19

lib/struct-to-schema.js

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

var rules = [[_.isString, function (value) {
return { type: value };
return handle(value);
}],

@@ -28,2 +28,19 @@ // Empty array -> array of any items

function handle(value) {
return {
type: value,
default: getDefault(value),
description: 'Description for this field'
};
}
function getDefault(value) {
var maps = {
string: 'default value',
number: 100,
boolean: true
};
return maps[value] ? maps[value] : maps.string;
}
function structToSchema(data) {

@@ -30,0 +47,0 @@ var _iteratorNormalCompletion = true;

2

package.json
{
"name": "leaf-converter",
"description": "",
"version": "1.4.3",
"version": "1.5.0",
"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