Rename argument
This commit is contained in:
@@ -15,8 +15,8 @@ module.exports = function aggregationValidator (mapconfig) {
|
||||
};
|
||||
|
||||
module.exports.createIncludesValueValidator = function (mapconfig, validValues) {
|
||||
return function validateIncludesValue (prop, key, index) {
|
||||
if (!validValues.includes(prop)) {
|
||||
return function validateIncludesValue (value, key, index) {
|
||||
if (!validValues.includes(value)) {
|
||||
const error = new Error(`Invalid ${key}. Valid values: ${validValues.join(', ')}`);
|
||||
error.type = 'layer';
|
||||
error.layer = {
|
||||
@@ -31,8 +31,8 @@ module.exports.createIncludesValueValidator = function (mapconfig, validValues)
|
||||
};
|
||||
|
||||
module.exports.createPositiveNumberValidator = function (mapconfig) {
|
||||
return function validatePositiveNumber (prop, key, index) {
|
||||
if (!Number.isFinite(prop) || prop <= 0) {
|
||||
return function validatePositiveNumber (value, key, index) {
|
||||
if (!Number.isFinite(value) || value <= 0) {
|
||||
const error = new Error(`Invalid ${key}, should be a number greather than 0`);
|
||||
error.type = 'layer';
|
||||
error.layer = {
|
||||
|
||||
Reference in New Issue
Block a user