���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.2
/
@vueuse
/
integrations
/
Viewing: useIDBKeyval.mjs
import { toValue } from '@vueuse/shared'; import { watchPausable } from '@vueuse/core'; import { ref, shallowRef, toRaw } from 'vue-demi'; import { get, set, del, update } from 'idb-keyval'; function useIDBKeyval(key, initialValue, options = {}) { const { flush = "pre", deep = true, shallow = false, onError = (e) => { console.error(e); }, writeDefaults = true } = options; const isFinished = ref(false); const data = (shallow ? shallowRef : ref)(initialValue); const rawInit = toValue(initialValue); async function read() { try { const rawValue = await get(key); if (rawValue === void 0) { if (rawInit !== void 0 && rawInit !== null && writeDefaults) await set(key, rawInit); } else { data.value = rawValue; } } catch (e) { onError(e); } isFinished.value = true; } read(); async function write() { try { if (data.value == null) { await del(key); } else { await update(key, () => toRaw(data.value)); } } catch (e) { onError(e); } } const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, () => write(), { flush, deep }); async function setData(value) { pauseWatch(); data.value = value; await write(); resumeWatch(); } return { set: setData, isFinished, data }; } export { useIDBKeyval };
Coded With 💗 by
0x6ick Mod By V1rus_Alfa