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

genmo

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genmo - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

strategies/any.js

2

package.json
{
"name": "genmo",
"version": "0.2.0",
"version": "0.2.1",
"description": "Generates models based off of json-schemas",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,2 +1,9 @@

var any = require('./any')
module.exports = function (schema) {
var value = any(schema)
if (value) {
return value
}
var max = getMax(schema)

@@ -3,0 +10,0 @@ var min = getMin(schema)

@@ -0,2 +1,9 @@

var any = require('./any')
module.exports = function (schema) {
var value = any(schema)
if (value) {
return value
}
var max = getMax(schema)

@@ -3,0 +10,0 @@ var min = getMin(schema)

var loremIpsum = require('lorem-ipsum')
var randexp = require('randexp').randexp
var any = require('./any')
module.exports = function (schema) {
var value = any(schema)
if (value) {
return value
}
var minLength = schema.minLength || 1

@@ -6,0 +12,0 @@ var maxLength = schema.maxLength || minLength + 10

@@ -92,1 +92,10 @@ var tape = require('tape')

})
tape('integer returns a value from enum if present', function (t) {
var schema = {
type: 'integer',
enum: [1,2,3,4,5,6,7,8,9,0]
}
t.notEqual(schema.enum.indexOf(integer(schema)), -1)
t.end()
})

@@ -84,1 +84,10 @@ var tape = require('tape')

})
tape('number returns a value from enum if present', function (t) {
var schema = {
type: 'integer',
enum: [1,2,3,4,5,6,7,8,9,0]
}
t.notEqual(schema.enum.indexOf(number(schema)), -1)
t.end()
})

@@ -45,5 +45,13 @@ var tape = require('tape')

var s = string(schema)
console.log(s)
t.equal(new RegExp(regex).test(s), true)
t.end()
})
tape('string returns a value from enum if present', function (t) {
var schema = {
type: 'integer',
enum: ['a', 'b', 'c', 'd', 'e', 'f', 'g']
}
t.notEqual(schema.enum.indexOf(string(schema)), -1)
t.end()
})
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