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

smartystreets-javascript-sdk

Package Overview
Dependencies
Maintainers
1
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 1.4.5 to 1.5.0

src/LicenseSender.js

3

examples/international_street.js

@@ -12,5 +12,6 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let key = process.env.SMARTY_WEBSITE_KEY;
const credentials = new SmartyStreetsCore.SharedCredentials(key);
const credentials = new SmartyStreetsCore.SharedCredentials(key);
let client = SmartyStreetsCore.buildClient.internationalStreet(credentials);
// .withLicenses(["international-select-plus-gbr-cloud"]);

@@ -17,0 +18,0 @@ // Documentation for input fields can be found at:

@@ -12,4 +12,5 @@ const SmartyStreetsSDK = require("smartystreets-javascript-sdk");

let key = process.env.SMARTY_WEBSITE_KEY;
const credentials = new SmartyStreetsCore.SharedCredentials(key);
const credentials = new SmartyStreetsCore.SharedCredentials(key);
let client = SmartyStreetsCore.buildClient.usStreet(credentials);
// .withLicenses(["us-core-cloud"]);

@@ -31,4 +32,4 @@ // Documentation for input fields can be found at:

lookup1.match = "invalid"; // "invalid" is the most permissive match,
// this will always return at least one result even if the address is invalid.
// Refer to the documentation for additional MatchStrategy options.
// this will always return at least one result even if the address is invalid.
// Refer to the documentation for additional MatchStrategy options.

@@ -35,0 +36,0 @@ let lookup2 = new Lookup();

{
"name": "smartystreets-javascript-sdk",
"version": "1.4.5",
"version": "1.5.0",
"description": "Quick and easy SmartyStreets address validation.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -9,2 +9,3 @@ const HttpSender = require("./HttpSender");

const StatusCodeSender = require("./StatusCodeSender");
const LicenseSender = require("./LicenseSender");
const BadCredentialsError = require("./Errors").BadCredentialsError;

@@ -44,2 +45,3 @@

this.debug = undefined;
this.licenses = [];

@@ -134,3 +136,16 @@ function noCredentialsProvided() {

/**
* Allows the caller to specify the subscription license (aka "track") they wish to use.
* @param licenses A String Array of licenses.
* @returns Returns <b>this</b> to accommodate method chaining.
*/
withLicenses(licenses) {
for (const license in licenses) {
this.licenses.push(license);
}
return this;
}
buildSender() {

@@ -145,4 +160,5 @@ if (this.httpSender) return this.httpSender;

const baseUrlSender = new BaseUrlSender(customHeaderSender, this.baseUrl);
const licenseSender = new LicenseSender(baseUrlSender, this.licenses);
return baseUrlSender;
return licenseSender;
}

@@ -149,0 +165,0 @@

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