UNPKG

smartystreets-javascript-sdk

Version:
2 lines (1 loc) 520 B
import{__require as r}from"./Errors.mjs";import{__require as e}from"./SharedCredentials.mjs";var s,t;function n(){if(t)return s;t=1;const n=r().UnprocessableEntityError,i=e();return s=class{constructor(r,e){this.signer=e,this.sender=r}send(r){if(r.payload&&this.signer instanceof i){throw new n("Shared credentials cannot be used in batches with a length greater than 1 or when using the US Extract API.")}return new Promise(((e,s)=>{this.signer.sign(r),this.sender.send(r).then(e).catch(s)}))}}}export{n as __require};