Comparing version 1.0.1 to 1.0.2
/*! | ||
* vue-ls.js 1.0.0 | ||
* vue-ls.js 1.0.1 | ||
* (c) 2017 Igor Ognichenko <igor.ognichenko@gmail.com> | ||
@@ -15,2 +15,4 @@ * Released under the MIT License. | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -41,3 +43,8 @@ | ||
function emit(listener) { | ||
listener(JSON.parse(e.newValue), JSON.parse(e.oldValue), e.url || e.uri); | ||
var item = JSON.parse(e.newValue); | ||
var oldItem = JSON.parse(e.oldValue); | ||
var val = (typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' ? item.value : oldItem; | ||
var oldVal = oldItem && (typeof oldItem === 'undefined' ? 'undefined' : _typeof(oldItem)) === 'object' ? oldItem.value : oldItem; | ||
listener(val, oldVal, e.url || e.uri); | ||
} | ||
@@ -44,0 +51,0 @@ } |
{ | ||
"name": "vue-ls", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "vue.js localStorage plugin", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-ls.js", |
@@ -26,3 +26,8 @@ let listeners = {}; | ||
function emit (listener) { | ||
listener(JSON.parse(e.newValue), JSON.parse(e.oldValue), e.url || e.uri); | ||
let item = JSON.parse(e.newValue); | ||
let oldItem = JSON.parse(e.oldValue); | ||
let val = typeof item === 'object' ? item.value : oldItem; | ||
let oldVal = oldItem && typeof oldItem === 'object' ? oldItem.value : oldItem; | ||
listener(val, oldVal, e.url || e.uri); | ||
} | ||
@@ -138,2 +143,2 @@ } | ||
window.Vue.use(new vueLocalStorage); | ||
} | ||
} |
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
70289
299