better-ajv-errors
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -65,3 +65,3 @@ 'use strict'; | ||
} else { | ||
return _chalk2.default`☝🏽 Unexpected value here`; | ||
return _chalk2.default`☝🏽 Unexpected value, should be equal to one of the allowed values`; | ||
} | ||
@@ -105,2 +105,6 @@ })); | ||
if (!currentValue) { | ||
return null; | ||
} | ||
var bestMatch = allowedValues.map(function (value) { | ||
@@ -115,3 +119,3 @@ return { | ||
return allowedValues.length === 1 || bestMatch.weight < 5 ? bestMatch.value : null; | ||
return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null; | ||
}; | ||
@@ -118,0 +122,0 @@ |
@@ -38,3 +38,3 @@ 'use strict'; | ||
} else { | ||
return _chalk2.default`☝🏽 Unexpected value here`; | ||
return _chalk2.default`☝🏽 Unexpected value, should be equal to one of the allowed values`; | ||
} | ||
@@ -67,2 +67,6 @@ })); | ||
if (!currentValue) { | ||
return null; | ||
} | ||
const bestMatch = allowedValues.map(value => ({ | ||
@@ -73,3 +77,3 @@ value, | ||
return allowedValues.length === 1 || bestMatch.weight < 5 ? bestMatch.value : null; | ||
return allowedValues.length === 1 || bestMatch.weight < bestMatch.value.length ? bestMatch.value : null; | ||
} | ||
@@ -76,0 +80,0 @@ } |
{ | ||
"name": "better-ajv-errors", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "JSON Schema validation for Human", | ||
@@ -15,3 +15,4 @@ "repository": "torifat/better-ajv-errors", | ||
"Rifat Nabi <to.rifat@gmail.com>", | ||
"Dmitrii Sorin <info@staypositive.ru>" | ||
"Dmitrii Sorin <info@staypositive.ru>", | ||
"Tong Li" | ||
], | ||
@@ -33,3 +34,3 @@ "license": "MIT", | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^22.0.6", | ||
"babel-jest": "^22.1.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
@@ -40,10 +41,10 @@ "babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"codecov": "^3.0.0", | ||
"eslint": "^4.15.0", | ||
"eslint": "^4.16.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-jest": "^21.6.2", | ||
"eslint-plugin-jest": "^21.7.0", | ||
"flow-bin": "^0.63.1", | ||
"husky": "^0.14.3", | ||
"jest": "^22.0.6", | ||
"jest": "^22.1.4", | ||
"jest-fixtures": "^0.6.0", | ||
"lint-staged": "^6.0.0", | ||
"lint-staged": "^6.0.1", | ||
"prettier": "^1.7.4" | ||
@@ -50,0 +51,0 @@ }, |
@@ -7,3 +7,3 @@ # better-ajv-errors | ||
[![CircleCI](https://img.shields.io/circleci/project/github/torifat/better-ajv-errors.svg?style=flat-square)](https://circleci.com/gh/torifat/better-ajv-errors) | ||
[![Codecov](https://img.shields.io/codecov/c/github/torifat/better-ajv-errors.svg.svg?style=flat-square)](https://codecov.io/gh/torifat/better-ajv-errors) | ||
[![Codecov](https://img.shields.io/codecov/c/github/torifat/better-ajv-errors.svg?style=flat-square)](https://codecov.io/gh/torifat/better-ajv-errors) | ||
[![bitHound](https://img.shields.io/bithound/dependencies/github/torifat/better-ajv-errors.svg?style=flat-square)](https://www.bithound.io/github/torifat/better-ajv-errors) | ||
@@ -10,0 +10,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59611
1546