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

skhema

Package Overview
Dependencies
Maintainers
1
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skhema - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1-empty-merge-6c5f411f3eac1b032bd0079852d4ff2bbbd45fa5

6

CHANGELOG.md

@@ -7,4 +7,8 @@ # Change Log

## v2.3.0 - 2018-09-06
## v2.3.1 - 2018-10-08
* Merge: When merging an empty array, return a wildcard schema [Lucian Buzzo]
## v2.3.0 - 2018-09-05
* Feat: Add functionality for scoring a schema match by specificity [Lucian Buzzo]

@@ -11,0 +15,0 @@

@@ -571,2 +571,10 @@ /*

exports.merge = (schemas) => {
// If no schemas are provided, return a "wildcard" skhema
if (schemas.length === 0) {
return {
type: 'object',
additionalProperties: true
}
}
if (schemas.length === 1 && schemas[0].type) {

@@ -573,0 +581,0 @@ return schemas[0]

2

package.json
{
"name": "skhema",
"version": "2.3.0",
"version": "2.3.1-empty-merge-6c5f411f3eac1b032bd0079852d4ff2bbbd45fa5",
"description": "JSON Schema utility collection",

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

@@ -651,2 +651,13 @@ /*

ava.test('.merge() should add `additionalProperties` true, if merging an empty array', (test) => {
const schemas = []
const finalSchema = skhema.merge(schemas)
test.deepEqual(finalSchema, {
type: 'object',
additionalProperties: true
})
})
_.each(SCORE_TEST_CASES, (testCase, index) => {

@@ -653,0 +664,0 @@ ava.test(`.scoreMatch() should merge test case ${index}`, (test) => {

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