mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
2 lines
1.4 KiB
JavaScript
2 lines
1.4 KiB
JavaScript
"use strict";(self["webpackChunkjandl"]=self["webpackChunkjandl"]||[]).push([[3474],{13474:function(e,t,s){s.d(t,{PreferencesWeb:function(){return r}});s(28743),s(83725),s(35019),s(51339);var i=s(32717);class r extends i.E_{constructor(){super(...arguments),this.group="CapacitorStorage"}async configure({group:e}){"string"===typeof e&&(this.group=e)}async get(e){const t=this.impl.getItem(this.applyPrefix(e.key));return{value:t}}async set(e){this.impl.setItem(this.applyPrefix(e.key),e.value)}async remove(e){this.impl.removeItem(this.applyPrefix(e.key))}async keys(){const e=this.rawKeys().map(e=>e.substring(this.prefix.length));return{keys:e}}async clear(){for(const e of this.rawKeys())this.impl.removeItem(e)}async migrate(){var e;const t=[],s=[],i="_cap_",r=Object.keys(this.impl).filter(e=>0===e.indexOf(i));for(const n of r){const r=n.substring(i.length),a=null!==(e=this.impl.getItem(n))&&void 0!==e?e:"",{value:p}=await this.get({key:r});"string"===typeof p?s.push(r):(await this.set({key:r,value:a}),t.push(r))}return{migrated:t,existing:s}}async removeOld(){const e="_cap_",t=Object.keys(this.impl).filter(t=>0===t.indexOf(e));for(const s of t)this.impl.removeItem(s)}get impl(){return window.localStorage}get prefix(){return"NativeStorage"===this.group?"":`${this.group}.`}rawKeys(){return Object.keys(this.impl).filter(e=>0===e.indexOf(this.prefix))}applyPrefix(e){return this.prefix+e}}}}]);
|
|
//# sourceMappingURL=3474.1db02bf0.js.map
|