Rename argument

This commit is contained in:
Daniel García Aubert
2017-12-18 19:52:50 +01:00
parent c63226cd26
commit fa7140e736

View File

@@ -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 = {