@orderingstack/front-hooks 3.12.0 → 3.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-8109ad88.mjs +7379 -0
- package/dist/index-8109ad88.mjs.map +1 -0
- package/dist/index-d65da522.js +16 -0
- package/dist/index-d65da522.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +34 -1
- package/dist/src/storage.d.ts +0 -1
- package/dist/src/storage.d.ts.map +1 -1
- package/dist/web-cfc85d5c.js +2 -0
- package/dist/web-cfc85d5c.js.map +1 -0
- package/dist/web-e02d3831.mjs +37 -0
- package/dist/web-e02d3831.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/web.js +0 -2
- package/dist/web.js.map +0 -1
package/dist/web.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=require("./index.js");require("react");require("@orderingstack/ordering-core-react");require("react-i18next");class i extends t.WebPlugin{constructor(){super(...arguments),this.PREFIX="cap_sec_",this.addPrefix=e=>this.PREFIX+e,this.removePrefix=e=>e.replace(this.PREFIX,"")}get(e){const r=localStorage.getItem(this.addPrefix(e.key));return r!==null?Promise.resolve({value:atob(r)}):Promise.reject("Item with given key does not exist")}set(e){return localStorage.setItem(this.addPrefix(e.key),btoa(e.value)),Promise.resolve({value:!0})}remove(e){return localStorage.getItem(this.addPrefix(e.key))?(localStorage.removeItem(this.addPrefix(e.key)),Promise.resolve({value:!0})):Promise.reject("Item with given key does not exist")}clear(){for(const e in localStorage)e.indexOf(this.PREFIX)===0&&localStorage.removeItem(e);return Promise.resolve({value:!0})}keys(){const e=Object.keys(localStorage).filter(r=>r.indexOf(this.PREFIX)===0).map(this.removePrefix);return Promise.resolve({value:e})}getPlatform(){return Promise.resolve({value:"web"})}}exports.SecureStoragePluginWeb=i;
|
|
2
|
-
//# sourceMappingURL=web.js.map
|
package/dist/web.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sources":["../node_modules/capacitor-secure-storage-plugin/dist/esm/web.js"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\nexport class SecureStoragePluginWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.PREFIX = 'cap_sec_';\n this.addPrefix = (key) => this.PREFIX + key;\n this.removePrefix = (key) => key.replace(this.PREFIX, '');\n }\n get(options) {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? Promise.resolve({\n value: atob(value),\n })\n : Promise.reject('Item with given key does not exist');\n }\n set(options) {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return Promise.resolve({ value: true });\n }\n remove(options) {\n if (localStorage.getItem(this.addPrefix(options.key))) {\n localStorage.removeItem(this.addPrefix(options.key));\n return Promise.resolve({ value: true });\n }\n else {\n return Promise.reject('Item with given key does not exist');\n }\n }\n clear() {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return Promise.resolve({ value: true });\n }\n keys() {\n const keys = Object.keys(localStorage)\n .filter(k => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return Promise.resolve({ value: keys });\n }\n getPlatform() {\n return Promise.resolve({ value: 'web' });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["WebPlugin"],"mappings":"oMACO,MAAM,SAA+BA,GAAAA,SAAU,CAClD,aAAc,CACV,MAAM,GAAG,SAAS,EAClB,KAAK,OAAS,WACd,KAAK,UAAY,AAAC,GAAQ,KAAK,OAAS,EACxC,KAAK,aAAe,AAAC,GAAQ,EAAI,QAAQ,KAAK,OAAQ,EAAE,CAC3D,CACD,IAAI,EAAS,CACT,KAAM,GAAQ,aAAa,QAAQ,KAAK,UAAU,EAAQ,GAAG,CAAC,EAC9D,MAAO,KAAU,KACX,QAAQ,QAAQ,CACd,MAAO,K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