Comparing version 2.2.15 to 2.2.16
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e["vue-ls"]=n()}(this,function(){"use strict";function e(e){function n(n){n(e.newValue?JSON.parse(e.newValue).value:e.newValue,e.oldValue?JSON.parse(e.oldValue).value:e.oldValue,e.url||e.uri)}if(e||(e=window.event),"undefined"!=typeof e&&"undefined"!=typeof e.key){var t=a[e.key];"undefined"!=typeof t&&t.forEach(n)}}var n={},t={getItem:function(e){return e in n?n[e]:null},setItem:function(e,t){return n[e]=t,!0},removeItem:function(e){var t=e in n;return!!t&&delete n[e]},clear:function(){return n={},!0},key:function(e){var t=Object.keys(n);return"undefined"!=typeof t[e]?t[e]:null}};Object.defineProperty(t,"length",{get:function(){return Object.keys(n).length}});var o=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a={},s=function(){function n(t,i){if(o(this,n),this.storage=t,this.options=r({namespace:"",events:["storage"]},i||{}),Object.defineProperty(this,"length",{get:function(){return this.storage.length}}),"undefined"!=typeof window)for(var a in this.options.events)window.addEventListener?window.addEventListener(this.options.events[a],e,!1):window.attachEvent?window.attachEvent("on"+this.options.events[a],e):window["on"+this.options.events[a]]=e}return i(n,[{key:"set",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.storage.setItem(this.options.namespace+e,JSON.stringify({value:n,expire:null!==t?(new Date).getTime()+t:null}))}},{key:"get",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=this.storage.getItem(this.options.namespace+e);if(null!==t){var o=JSON.parse(t);if(null===o.expire)return o.value;if(o.expire>=(new Date).getTime())return o.value;this.remove(e)}return n}},{key:"key",value:function(e){return this.storage.key(e)}},{key:"remove",value:function(e){return this.storage.removeItem(this.options.namespace+e)}},{key:"clear",value:function(){if(0!==this.length){for(var e=[],n=0;n<this.length;n++){var t=this.storage.key(n),o=new RegExp("^"+this.options.namespace+".+","i");o.test(t)!==!1&&e.push(t)}for(var i in e)this.storage.removeItem(e[i])}}},{key:"on",value:function(e,n){a[this.options.namespace+e]?a[this.options.namespace+e].push(n):a[this.options.namespace+e]=[n]}},{key:"off",value:function(e,n){var t=a[this.options.namespace+e];t.length>1?t.splice(t.indexOf(n),1):a[this.options.namespace+e]=[]}}]),n}(),u="undefined"!=typeof window&&"localStorage"in window?window.localStorage:t,l=new s(u),f={install:function(e,n){l.options=r(l.options,{namespace:""},n||{}),e.ls=l,Object.defineProperty(e.prototype,"$ls",{get:function(){return l}})}};return"undefined"!=typeof window&&(window.VueLocalStorage=f),f}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e["vue-ls"]=n()}(this,function(){"use strict";function e(e){function n(n){n(e.newValue?JSON.parse(e.newValue).value:e.newValue,e.oldValue?JSON.parse(e.oldValue).value:e.oldValue,e.url||e.uri)}if(e||(e=window.event),void 0!==e&&void 0!==e.key){var t=a[e.key];void 0!==t&&t.forEach(n)}}var n={},t={getItem:function(e){return e in n?n[e]:null},setItem:function(e,t){return n[e]=t,!0},removeItem:function(e){return!!(e in n)&&delete n[e]},clear:function(){return n={},!0},key:function(e){var t=Object.keys(n);return void 0!==t[e]?t[e]:null}};Object.defineProperty(t,"length",{get:function(){return Object.keys(n).length}});var o=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a={},s=new(function(){function n(t,i){if(o(this,n),this.storage=t,this.options=r({namespace:"",events:["storage"]},i||{}),Object.defineProperty(this,"length",{get:function(){return this.storage.length}}),"undefined"!=typeof window)for(var a in this.options.events)window.addEventListener?window.addEventListener(this.options.events[a],e,!1):window.attachEvent?window.attachEvent("on"+this.options.events[a],e):window["on"+this.options.events[a]]=e}return i(n,[{key:"set",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.storage.setItem(this.options.namespace+e,JSON.stringify({value:n,expire:null!==t?(new Date).getTime()+t:null}))}},{key:"get",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=this.storage.getItem(this.options.namespace+e);if(null!==t){var o=JSON.parse(t);if(null===o.expire)return o.value;if(o.expire>=(new Date).getTime())return o.value;this.remove(e)}return n}},{key:"key",value:function(e){return this.storage.key(e)}},{key:"remove",value:function(e){return this.storage.removeItem(this.options.namespace+e)}},{key:"clear",value:function(){if(0!==this.length){for(var e=[],n=0;n<this.length;n++){var t=this.storage.key(n);!1!==new RegExp("^"+this.options.namespace+".+","i").test(t)&&e.push(t)}for(var o in e)this.storage.removeItem(e[o])}}},{key:"on",value:function(e,n){a[this.options.namespace+e]?a[this.options.namespace+e].push(n):a[this.options.namespace+e]=[n]}},{key:"off",value:function(e,n){var t=a[this.options.namespace+e];t.length>1?t.splice(t.indexOf(n),1):a[this.options.namespace+e]=[]}}]),n}())("undefined"!=typeof window&&"localStorage"in window?window.localStorage:t),u={install:function(e,n){s.options=r(s.options,{namespace:""},n||{}),e.ls=s,Object.defineProperty(e.prototype,"$ls",{get:function(){return s}})}};return"undefined"!=typeof window&&(window.VueLocalStorage=u),u}); | ||
//# sourceMappingURL=vue-ls.min.js.map |
{ | ||
"name": "vue-ls", | ||
"version": "2.2.15", | ||
"version": "2.2.16", | ||
"description": "Vue plugin for work with LocalStorage from Vue context", | ||
@@ -81,3 +81,3 @@ "main": "dist/vue-ls.js", | ||
"gulp-sourcemaps": "^2.4.1", | ||
"gulp-uglify": "^2.0.1", | ||
"gulp-uglify": "^3.0.0", | ||
"gulp-util": "^3.0.8", | ||
@@ -84,0 +84,0 @@ "jasmine": "^2.5.3", |
@@ -21,3 +21,3 @@ <p align="center"> | ||
<a href="https://david-dm.org/robinck/vue-ls"><img src="https://img.shields.io/david/RobinCk/vue-ls.svg?style=flat-square"></a> | ||
<a href="https://david-dm.org/robinck/vue-ls#info=devDependencies&view=table"><img src="https://img.shields.io/david/dev/RobinCk/vue-ls.svg?style=flat-square"></a> | ||
<a href="https://david-dm.org/robinck/vue-ls?type=dev"><img src="https://img.shields.io/david/dev/RobinCk/vue-ls.svg?style=flat-square"></a> | ||
<a href="https://github.com/RobinCK/vue-ls"><img src="https://img.shields.io/bower/v/vue-ls.svg?style=flat-square"></a> | ||
@@ -24,0 +24,0 @@ <a href="https://www.npmjs.com/package/vue-ls"><img src="https://img.shields.io/npm/v/vue-ls.svg?style=flat-square"></a> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29164