Browse Source

switch to simpler check since we know what's coming back

pull/912/head
Stephen Hess 8 years ago
parent
commit
9aca556dd3
  1. 2
      controller/libpostal.js

2
controller/libpostal.js

@ -12,7 +12,7 @@ function setup(should_execute) {
// parse text with query parser // parse text with query parser
const parsed_text = text_analyzer.parse(req.clean.text); const parsed_text = text_analyzer.parse(req.clean.text);
if (!_.isUndefined(parsed_text)) { if (parsed_text !== undefined) {
// if a known ISO2 country was parsed, convert it to ISO3 // if a known ISO2 country was parsed, convert it to ISO3
if (_.has(parsed_text, 'country') && iso3166.is2(_.toUpper(parsed_text.country))) { if (_.has(parsed_text, 'country') && iso3166.is2(_.toUpper(parsed_text.country))) {
parsed_text.country = iso3166.to3(_.toUpper(parsed_text.country)); parsed_text.country = iso3166.to3(_.toUpper(parsed_text.country));

Loading…
Cancel
Save