carto-geocoding-sql
Advanced tools
Comparing version 0.0.2 to 0.0.3
10
index.js
@@ -12,4 +12,10 @@ /*eslint no-undef: "error"*/ | ||
} | ||
var locations = (arguments.length > 1) ? Array.prototype.slice.call(arguments) : [arguments[0]]; | ||
var locations; | ||
if (arguments.length > 1) { | ||
locations = Array.prototype.slice.call(arguments); | ||
} else if (Array.isArray(arguments[0])) { | ||
locations = arguments[0]; | ||
} else { | ||
locations = [arguments[0]]; | ||
} | ||
var fragmentFunctionList = locations.map(function(location) { | ||
@@ -16,0 +22,0 @@ return geocode(location); |
{ | ||
"name": "carto-geocoding-sql", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Turns simple text locations into SQL queries to be run against CARTO geocoding API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -47,2 +47,5 @@ /*eslint-env mocha*/ | ||
}); | ||
it('should work with multiple geocodes in an array', function() { | ||
expect(geocode(['Utrecht', '81.204.10.10', 'Roelof Hartplein 2G, Amsterdam, Nederland'])).to.equal("SELECT cdb_geocode_namedplace_point('Utrecht') the_geom UNION SELECT cdb_geocode_ipaddress_point('81.204.10.10') the_geom UNION SELECT cdb_geocode_street_point('Roelof Hartplein 2G','Amsterdam','','Nederland') the_geom;"); | ||
}); | ||
/* eslint-enable quotes */ | ||
@@ -49,0 +52,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15421
296