mirror of https://github.com/pelias/api.git
Stephen Hess
7 years ago
7 changed files with 23 additions and 5 deletions
@ -1,3 +1,3 @@
|
||||
const _ = require('lodash'); |
||||
|
||||
module.exports = (parameter) => (req, res) => _.has(req, ['clean', parameter]); |
||||
module.exports = (parameter) => (req, res) => (_.has(req, ['clean', parameter])); |
||||
|
@ -1,4 +1,4 @@
|
||||
const _ = require('lodash'); |
||||
|
||||
// returns true iff req.clean.parser is addressit
|
||||
module.exports = (req, res) => _.get(req, 'clean.parser') === 'addressit'; |
||||
module.exports = (req, res) => (_.get(req, 'clean.parser') === 'addressit'); |
||||
|
@ -1,5 +1,7 @@
|
||||
const _ = require('lodash'); |
||||
|
||||
// return IFF req.clean.layers is empty OR there are non-venue/address/street layers
|
||||
module.exports = (req, res) => !_.isEmpty(_.get(req, 'clean.layers', [])) && |
||||
_.isEmpty(_.difference(req.clean.layers, ['venue', 'address', 'street'])); |
||||
module.exports = (req, res) => ( |
||||
!_.isEmpty(_.get(req, 'clean.layers', [])) && |
||||
_.isEmpty(_.difference(req.clean.layers, ['venue', 'address', 'street'])) |
||||
); |
||||
|
@ -1,3 +1,9 @@
|
||||
const _ = require('lodash'); |
||||
|
||||
module.exports = (req, res) => _.isEqual(_.get(req, 'clean.sources', []), ['whosonfirst']); |
||||
// returns true IFF clean.sources only contains 'whosonfirst'
|
||||
module.exports = (req, res) => ( |
||||
_.isEqual( |
||||
_.get(req, 'clean.sources', []), |
||||
['whosonfirst'] |
||||
) |
||||
); |
||||
|
Loading…
Reference in new issue