mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
610 B
17 lines
610 B
const _ = require('lodash'); |
|
const Debug = require('../../helper/debug'); |
|
const debugLog = new Debug('controller:predicates:is_request_sources_only_whosonfirst'); |
|
const stackTraceLine = require('../../helper/stackTraceLine'); |
|
|
|
// returns true IFF 'whosonfirst' is the only requested source |
|
module.exports = (req, res) => { |
|
const is_request_sources_only_whosonfirst = _.isEqual( |
|
_.get(req, 'clean.sources', []), |
|
['whosonfirst'] |
|
); |
|
debugLog.push(req, () => ({ |
|
reply: is_request_sources_only_whosonfirst, |
|
stack_trace: stackTraceLine() |
|
})); |
|
return is_request_sources_only_whosonfirst; |
|
};
|
|
|