smartystreets-javascript-sdk
Version:
Quick and easy Smarty address validation.
2 lines (1 loc) • 672 B
JavaScript
import{__require as r}from"../Errors.mjs";import{__require as e}from"../Request.mjs";import{__require as s}from"./Suggestion.mjs";import{__require as o}from"../util/buildInputData.mjs";import{__require as t}from"../util/apiToSDKKeyMap.mjs";var i,u;function n(){if(u)return i;u=1;const n=r(),a=e(),m=s(),p=o(),_=t().usAutocompletePro;return i=class{constructor(r){this.sender=r}send(r){if(void 0===r)throw new n.UndefinedLookupError;let e=new a;return e.parameters=p(r,_),new Promise(((s,o)=>{this.sender.send(e).then((e=>{var t;e.error&&o(e.error),r.result=null===(t=e.payload).suggestions?[]:t.suggestions.map((r=>new m(r))),s(r)})).catch(o)}))}}}export{n as __require};