smartystreets-javascript-sdk
Advanced tools
Comparing version 1.11.0 to 1.11.1
{ | ||
"name": "smartystreets-javascript-sdk", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "Quick and easy SmartyStreets address validation.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -32,5 +32,5 @@ const Errors = require("../Errors"); | ||
function buildSuggestionsFromResponse(payload) { | ||
if (payload === null) return []; | ||
if (payload && payload.candidates === null) return []; | ||
return payload.map(suggestion => new Suggestion(suggestion)); | ||
return payload.candidates.map(suggestion => new Suggestion(suggestion)); | ||
} | ||
@@ -37,0 +37,0 @@ } |
@@ -51,14 +51,17 @@ const chai = require("chai"); | ||
const responseData = { | ||
"street": "L alleya", | ||
"locality": "Novosibirsk", | ||
"administrative_area": "Novosibirskaya oblast'", | ||
"postal_code": "40000", | ||
"country_iso3": "RUS", | ||
candidates: [ | ||
{ | ||
"street": "L alleya", | ||
"locality": "Novosibirsk", | ||
"administrative_area": "Novosibirskaya oblast'", | ||
"postal_code": "40000", | ||
"country_iso3": "RUS", | ||
} | ||
] | ||
}; | ||
let mockExpectedPayload = [responseData]; | ||
let mockSender = new MockSenderWithResponse(mockExpectedPayload); | ||
let mockSender = new MockSenderWithResponse(responseData); | ||
let client = new Client(mockSender); | ||
let lookup = new Lookup("f"); | ||
let expectedSuggestion = new Suggestion(responseData); | ||
let expectedSuggestion = new Suggestion(responseData.candidates[0]); | ||
@@ -65,0 +68,0 @@ return client.send(lookup).then(() => { |
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
164407
3747