address-geoservices
Advanced tools
Comparing version 0.0.3 to 0.0.4
37
index.js
@@ -8,17 +8,4 @@ 'use strict'; | ||
module.exports = function(_apiKey, _version) { | ||
if (!_apiKey) { | ||
throw new Error('apiKey is required'); | ||
} | ||
if (!_version) { | ||
version = '4.01'; | ||
} else { | ||
version = _version; | ||
} | ||
apiKey = _apiKey; | ||
return funcs; | ||
}; | ||
var funcs = { | ||
normalizeAddress: function(addressObj, cb) { | ||
normalize: function(addressObj, cb) { | ||
var endpoint = 'https://geoservices.tamu.edu/Services/AddressNormalization/WebService/v04_01/HTTP/default.aspx'; | ||
@@ -44,3 +31,3 @@ | ||
}, | ||
validateAddress: function(addressObj, cb) { | ||
validate: function(addressObj, cb) { | ||
var endpoint = 'http://app.yurisw.com/YAddressWebService/YAddress.asmx/ProcessJson' | ||
@@ -66,5 +53,8 @@ , line1, line2; | ||
if (err) { return cb(err); } | ||
if (incomingMessage.statusCode < 200 || incomingMessage.statusCode > 299) { | ||
return cb(incomingMessage.statusCode); | ||
} | ||
try { | ||
var response = JSON.parse(response); | ||
response = JSON.parse(response); | ||
} catch (e) { | ||
@@ -78,4 +68,17 @@ return cb(e); | ||
cb(null, JSON.parse(response)); | ||
}) | ||
}); | ||
} | ||
}; | ||
module.exports = function(_apiKey, _version) { | ||
if (!_apiKey) { | ||
throw new Error('apiKey is required'); | ||
} | ||
if (!_version) { | ||
version = '4.01'; | ||
} else { | ||
version = _version; | ||
} | ||
apiKey = _apiKey; | ||
return funcs; | ||
}; |
{ | ||
"name": "address-geoservices", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Interacts with geoservices apis to help with managing addresses", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
2540
69