UNPKG

smartystreets-javascript-sdk

Version:
2 lines (1 loc) 473 B
"use strict";var e=require("./SharedCredentials.cjs"),r=require("./_virtual/Errors.cjs");exports.default=class{constructor(e,r){this.signer=r,this.sender=e}send(s){if(s.payload&&this.signer instanceof e.default){const e="Shared credentials cannot be used in batches with a length greater than 1 or when using the US Extract API.";throw new r.ErrorsExports.UnprocessableEntityError(e)}return new Promise((e,r)=>{this.signer.sign(s),this.sender.send(s).then(e).catch(r)})}};