New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

object-to-schema

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-to-schema - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

10

CHANGELOG.md

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

<a name="1.4.0"></a>
# [1.4.0](https://github.com/forsigner/object-to-schema/compare/v1.3.2...v1.4.0) (2017-12-29)
### Features
* use new seperator ([10e7559](https://github.com/forsigner/object-to-schema/commit/10e7559))
<a name="1.3.2"></a>

@@ -7,0 +17,0 @@ ## [1.3.2](https://github.com/forsigner/object-to-schema/compare/v1.3.1...v1.3.2) (2017-12-28)

2

example/index.js

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

const obj = {
'// name': [ null, [ '// user name' ]],
'// name': [ null, [ '// user name|maxLength:10' ]],
name: 'Tom',

@@ -9,0 +9,0 @@ times: [ 1, 2, 3 ],

@@ -9,2 +9,3 @@ 'use strict';

var _ = require('lodash');
var separator = '(@#$%)';
module.exports = objectToSchema;

@@ -75,3 +76,4 @@

var desc = getDesc(object['// ' + item]);
obj[item] = makeSchema(object[item] + '|' + type + '|' + desc);
var value = '' + object[item] + separator + type + separator + desc;
obj[item] = makeSchema(value);
} else {

@@ -104,2 +106,3 @@ obj[item] = makeSchema(object[item]);

if (!_.isArray(comment) || _.isEmpty(comment)) return '';
return (comment[1] || '').toString().replace(/^\/\//, '').trim();

@@ -149,3 +152,3 @@ }

}
var arr = value.split('|');
var arr = value.split(separator);
if (arr.length < 2) {

@@ -152,0 +155,0 @@ return { type: type, default: value };

{
"name": "object-to-schema",
"description": "",
"version": "1.3.2",
"version": "1.4.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