Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smartystreets-javascript-sdk

Package Overview
Dependencies
Maintainers
8
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smartystreets-javascript-sdk - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

examples/us_enrichment.js

5

package.json
{
"name": "smartystreets-javascript-sdk",
"version": "5.1.0",
"version": "5.1.1",
"description": "Quick and easy Smarty address validation.",

@@ -40,4 +40,5 @@ "keywords": [

"axios": "^1.6.2",
"axios-retry": "4.0.0"
"axios-retry": "4.0.0",
"smartystreets-javascript-sdk": "^5.1.1"
}
}

18

src/us_enrichment/Client.js

@@ -17,8 +17,4 @@ const Errors = require("../Errors");

if (lookup.smartyKey) {
request.baseUrlParam = lookup.smartyKey;
}
request.baseUrlParam = lookup.smartyKey + "/property/principal";
request.baseUrlParam = "property/principal";
return new Promise((resolve, reject) => {

@@ -42,8 +38,4 @@ this.sender.send(request)

if (lookup.smartyKey) {
request.baseUrlParam = lookup.smartyKey;
}
request.baseUrlParam = lookup.smartyKey + "/property/financial";
request.baseUrlParam = "property/financial";
return new Promise((resolve, reject) => {

@@ -67,8 +59,4 @@ this.sender.send(request)

if (lookup.smartyKey) {
request.baseUrlParam = lookup.smartyKey;
}
request.baseUrlParam = lookup.smartyKey + "/geo-reference";
request.baseUrlParam = "geo-reference";
return new Promise((resolve, reject) => {

@@ -75,0 +63,0 @@ this.sender.send(request)

@@ -9,2 +9,3 @@ const {buildSmartyResponse} = require("../../src/util/buildSmartyResponse.js");

parameters: undefined,
baseUrlParam: undefined,
};

@@ -16,2 +17,3 @@ this.request = request;

request.parameters = clientRequest.parameters;
request.baseUrlParam = clientRequest.baseUrlParam;
}

@@ -18,0 +20,0 @@ },

@@ -11,2 +11,35 @@ const chai = require("chai");

describe("A US Enrichment Client", function () {
it("composes principal url path properly", function () {
let mockSender = new MockSender();
let client = new Client(mockSender);
let smartyKey = "0";
let lookup = new Lookup(smartyKey);
client.sendPrincipal(lookup);
expect(mockSender.request.baseUrlParam).to.deep.equal("0/property/principal");
})
it("composes financial url path properly", function () {
let mockSender = new MockSender();
let client = new Client(mockSender);
let smartyKey = "0";
let lookup = new Lookup(smartyKey);
client.sendFinancial(lookup);
expect(mockSender.request.baseUrlParam).to.deep.equal("0/property/financial");
})
it("composes geo url path properly", function () {
let mockSender = new MockSender();
let client = new Client(mockSender);
let smartyKey = "0";
let lookup = new Lookup(smartyKey);
client.sendGeo(lookup);
expect(mockSender.request.baseUrlParam).to.deep.equal("0/geo-reference");
})
it("correctly builds parameters for a smartyKey only principal lookup.", function () {

@@ -13,0 +46,0 @@ let mockSender = new MockSender();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc