UNPKG

smartystreets-javascript-sdk

Version:
2 lines (1 loc) 449 B
import e from"./SharedCredentials.mjs";import{E as r}from"./_virtual/Errors.mjs";class s{constructor(e,r){this.signer=r,this.sender=e}send(s){if(s.payload&&this.signer instanceof e){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.UnprocessableEntityError(e)}return new Promise((e,r)=>{this.signer.sign(s),this.sender.send(s).then(e).catch(r)})}}export{s as default};