You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-persistent-storage-manager

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-persistent-storage-manager - npm Package Compare versions

Comparing version

to
2.1.1

2

dist/index.umd.js

@@ -1,1 +0,1 @@

var u=Object.defineProperty;var f=(s,e,r)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var n=(s,e,r)=>(f(s,typeof e!="symbol"?e+"":e,r),r);(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("/home/runner/work/yeger/yeger/node_modules/.pnpm/vue@2.7.14/node_modules/vue/dist/vue.runtime.esm.js")):typeof define=="function"&&define.amd?define(["exports","/home/runner/work/yeger/yeger/node_modules/.pnpm/vue@2.7.14/node_modules/vue/dist/vue.runtime.esm.js"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.VuePersistentStorageManager={},s.Vue))})(this,function(s,e){var m;"use strict";const r={watchStorage:!1},l=class{constructor(){n(this,"isAvailable",typeof navigator<"u"&&((m=navigator==null?void 0:navigator.storage)==null?void 0:m.persist)!==void 0);n(this,"storageEstimate",{quota:void 0,usage:void 0});n(this,"_isPersistent",!1);var t,o;!this.isAvailable||(this._refreshIsPersistent(),this._refreshStorageEstimate(),(o=(t=navigator.permissions)==null?void 0:t.query({name:"persistent-storage"}))==null||o.then(a=>{a.onchange=()=>this._refreshIsPersistent()}),window.addEventListener("storage",()=>{this._refreshStorageEstimate()}))}get isPersistent(){return this._isPersistent}requestPersistentStorage(){return this.isAvailable?navigator.storage.persist().then(t=>(this._isPersistent=t,t)):Promise.resolve(!1)}_refreshIsPersistent(){navigator.storage.persisted().then(t=>this._isPersistent=t)}_refreshStorageEstimate(){navigator.storage.estimate().then(({quota:t,usage:o})=>{e.set(this.storageEstimate,"quota",t),e.set(this.storageEstimate,"usage",o)})}_modifyLocalStorageFunctions(){if(typeof localStorage>"u")return;const t=this;typeof localStorage.originalSetItem>"u"&&(localStorage.originalSetItem=localStorage.setItem);const o=localStorage.setItem;localStorage.setItem=function(...i){o.apply(this,i),t._refreshStorageEstimate()},typeof localStorage.originalRemoveItem>"u"&&(localStorage.originalRemoveItem=localStorage.removeItem);const a=localStorage.removeItem;localStorage.removeItem=function(...i){a.apply(this,i),t._refreshStorageEstimate()}}};let g=l;n(g,"install",(t,o)=>{const a={...r,...o},i=e.observable(new l);a.watchStorage&&i._modifyLocalStorageFunctions(),t.prototype.$storageManager=i,t.prototype.$storageEstimate=i.storageEstimate}),s.VuePersistentStorageManager=g,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
var m=Object.defineProperty;var c=(s,e,r)=>e in s?m(s,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[e]=r;var n=(s,e,r)=>(c(s,typeof e!="symbol"?e+"":e,r),r);(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.VuePersistentStorageManager={},s.Vue))})(this,function(s,e){var f;"use strict";const r={watchStorage:!1},l=class{constructor(){n(this,"isAvailable",typeof navigator<"u"&&((f=navigator==null?void 0:navigator.storage)==null?void 0:f.persist)!==void 0);n(this,"storageEstimate",{quota:void 0,usage:void 0});n(this,"_isPersistent",!1);var t,o;!this.isAvailable||(this._refreshIsPersistent(),this._refreshStorageEstimate(),(o=(t=navigator.permissions)==null?void 0:t.query({name:"persistent-storage"}))==null||o.then(a=>{a.onchange=()=>this._refreshIsPersistent()}),window.addEventListener("storage",()=>{this._refreshStorageEstimate()}))}get isPersistent(){return this._isPersistent}requestPersistentStorage(){return this.isAvailable?navigator.storage.persist().then(t=>(this._isPersistent=t,t)):Promise.resolve(!1)}_refreshIsPersistent(){navigator.storage.persisted().then(t=>this._isPersistent=t)}_refreshStorageEstimate(){navigator.storage.estimate().then(({quota:t,usage:o})=>{e.set(this.storageEstimate,"quota",t),e.set(this.storageEstimate,"usage",o)})}_modifyLocalStorageFunctions(){if(typeof localStorage>"u")return;const t=this;typeof localStorage.originalSetItem>"u"&&(localStorage.originalSetItem=localStorage.setItem);const o=localStorage.setItem;localStorage.setItem=function(...i){o.apply(this,i),t._refreshStorageEstimate()},typeof localStorage.originalRemoveItem>"u"&&(localStorage.originalRemoveItem=localStorage.removeItem);const a=localStorage.removeItem;localStorage.removeItem=function(...i){a.apply(this,i),t._refreshStorageEstimate()}}};let g=l;n(g,"install",(t,o)=>{const a={...r,...o},i=e.observable(new l);a.watchStorage&&i._modifyLocalStorageFunctions(),t.prototype.$storageManager=i,t.prototype.$storageEstimate=i.storageEstimate}),s.VuePersistentStorageManager=g,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
{
"name": "vue-persistent-storage-manager",
"version": "2.1.0",
"version": "2.1.1",
"private": false,

@@ -5,0 +5,0 @@ "description": "Vue plugin that wraps the StorageManager API and provides the state of the persistent-storage permission alongside a storage estimate.",

Sorry, the diff of this file is not supported yet