diff --git a/src/customSanitizers.js b/src/customSanitizers.js index 42ccd803e04d167419f825048a74d63e862364cb..39a8b369d6ec1855d33422c531f1bddd9c788d89 100644 --- a/src/customSanitizers.js +++ b/src/customSanitizers.js @@ -1,6 +1,21 @@ const toLower = (value) => { - if(!value) return; + if (!value) return; return value.toLowerCase(); } -module.exports = { toLower }; \ No newline at end of file +const toUpper = (value) => { + if (!value) return; + return value.toUpperCase(); +} + +const boundingboxIsValid = (value) => { + let tokens = value.split(","); + tokens = tokens.map(token => parseFloat(token)); + if (tokens[0] < tokens[2] && tokens[1] < tokens[3]) { + return true; + } + return false; + +} + +module.exports = { toLower, toUpper, boundingboxIsValid }; \ No newline at end of file