ddf-query-validator
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -58,6 +58,9 @@ "use strict"; | ||
} | ||
errorMessages.push(checkIfSelectKeyHasInvalidDefinitions(fromClause, key, ALLOWED_KEYS), checkIfSelectValueHasInvalidDefinitions(fromClause, value, ALLOWED_VALUES)); | ||
errorMessages.push(checkIfSelectKeyHasInvalidDefinitions(fromClause, key, ALLOWED_KEYS), checkIfSelectValueHasInvalidDefinitions(query, value, ALLOWED_VALUES)); | ||
return compact(errorMessages); | ||
} | ||
function validateWhereDefinitions(query, options) { | ||
if (query.debug !== true) { | ||
return []; | ||
} | ||
const errorMessages = []; | ||
@@ -112,3 +115,7 @@ const whereClause = get(query, 'where', null); | ||
} | ||
function checkIfSelectValueHasInvalidDefinitions(fromClause, value, ALLOWED_VALUES) { | ||
function checkIfSelectValueHasInvalidDefinitions(query, value, ALLOWED_VALUES) { | ||
if (query.debug !== true) { | ||
return; | ||
} | ||
const fromClause = get(query, 'from', null); | ||
const unavailableValues = getUnavailableSelectItems(value, ALLOWED_VALUES); | ||
@@ -115,0 +122,0 @@ if (!isEmpty(value) && !isEmpty(unavailableValues)) { |
{ | ||
"name": "ddf-query-validator", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "DDF query validator", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -81,3 +81,3 @@ import * as isEmpty from 'lodash.isempty'; | ||
checkIfSelectKeyHasInvalidDefinitions(fromClause, key, ALLOWED_KEYS), | ||
checkIfSelectValueHasInvalidDefinitions(fromClause, value, ALLOWED_VALUES), | ||
checkIfSelectValueHasInvalidDefinitions(query, value, ALLOWED_VALUES), | ||
); | ||
@@ -89,2 +89,6 @@ | ||
function validateWhereDefinitions (query, options): string[] { | ||
if (query.debug !== true) { | ||
return []; | ||
} | ||
const errorMessages = []; | ||
@@ -160,3 +164,8 @@ const whereClause = get(query, 'where', null); | ||
function checkIfSelectValueHasInvalidDefinitions (fromClause, value, ALLOWED_VALUES) { | ||
function checkIfSelectValueHasInvalidDefinitions (query, value, ALLOWED_VALUES) { | ||
if (query.debug !== true) { | ||
return; | ||
} | ||
const fromClause = get(query, 'from', null); | ||
const unavailableValues: string[] = getUnavailableSelectItems(value, ALLOWED_VALUES); | ||
@@ -163,0 +172,0 @@ |
Sorry, the diff of this file is not supported yet
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
172695
2933