UNPKG

jr-util

Version:

这是MJR的JS工具库。定期更新

24 lines (23 loc) 359 B
function o(e, t) { localStorage.setItem(e, JSON.stringify(t)); } function n(e, t) { try { let r = localStorage.getItem(e); return r ? JSON.parse(r) : t; } catch { return t; } } function c(e) { localStorage.removeItem(e); } function a() { localStorage.clear(); } export { a as clearDb, n as getDb, c as removeDb, o as saveDb };