UNPKG

@privy-io/expo

Version:

Expo client for the Privy Auth API

2 lines (1 loc) 1.8 kB
var y=Object.defineProperty,m=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var i=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var u=(e,r,t)=>r in e?y(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,C=(e,r)=>{for(var t in r||(r={}))d.call(r,t)&&u(e,t,r[t]);if(i)for(var t of i(r))_.call(r,t)&&u(e,t,r[t]);return e},L=(e,r)=>m(e,E(r));var R=(e,r)=>{var t={};for(var o in e)d.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&i)for(var o of i(e))r.indexOf(o)<0&&_.call(e,o)&&(t[o]=e[o]);return t};var s=(e,r,t)=>new Promise((o,l)=>{var I=n=>{try{c(t.next(n))}catch(p){l(p)}},g=n=>{try{c(t.throw(n))}catch(p){l(p)}},c=n=>n.done?o(n.value):Promise.resolve(n.value).then(I,g);c((t=t.apply(e,r)).next())});import{applicationId as A}from"expo-application";import*as a from"expo-secure-store";import{PrivyClientError as T}from"@privy-io/js-sdk-core";var O=()=>{if(typeof A!="string")throw new T({error:"Cannot determine native application ID. Please make sure `expo-application` is installed as a dependency and that `ios.bundleId` or `android.package` is set.",code:"invalid_native_app_id"});return A},S=/[:/]/g;function k(e){return{get(r){return e.get(r.replaceAll(S,"-"))},put(r,t){return e.put(r.replaceAll(S,"-"),t)},del(r){return e.del(r.replaceAll(S,"-"))},getKeys:()=>s(this,null,function*(){return[]})}}var v={get(e){return a.getItemAsync(e,{keychainAccessible:a.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY})},put(e,r){return a.setItemAsync(e,r,{keychainAccessible:a.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY})},del(e){return a.deleteItemAsync(e,{keychainAccessible:a.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY})},getKeys:()=>s(void 0,null,function*(){return[]})};export{C as a,L as b,R as c,s as d,O as e,k as f,v as g};