|
|
|
@ -2,14 +2,14 @@
|
|
|
|
|
var place = require('../../../sanitiser/place'), |
|
|
|
|
_sanitize = place.sanitize, |
|
|
|
|
middleware = place.middleware, |
|
|
|
|
indeces = require('../../../query/indeces'), |
|
|
|
|
types = require('../../../query/types'), |
|
|
|
|
delimiter = ':', |
|
|
|
|
defaultLengthError = function(input) { return 'invalid param \''+ input + '\': text length, must be >0'; }, |
|
|
|
|
defaultFormatError = 'invalid: must be of the format type:id for ex: \'geoname:4163334\'', |
|
|
|
|
defaultError = 'invalid param \'id\': text length, must be >0', |
|
|
|
|
defaultMissingTypeError = function(input) { |
|
|
|
|
var type = input.split(delimiter)[0]; |
|
|
|
|
return type + ' is invalid. It must be one of these values - [' + indeces.join(', ') + ']'; }, |
|
|
|
|
return type + ' is invalid. It must be one of these values - [' + types.join(', ') + ']'; }, |
|
|
|
|
defaultClean = { ids: [ { id: '123', type: 'geoname' } ], details: true }, |
|
|
|
|
sanitize = function(query, cb) { _sanitize({'query':query}, cb); }, |
|
|
|
|
inputs = { |
|
|
|
|