micro-storage
Advanced tools
Comparing version 0.0.3 to 0.0.4
/*! | ||
* @ProjectName micro-storage | ||
* @Version 0.0.3 | ||
* @Version 0.0.4 | ||
* @Author lixinliang(https://github.com/lixinliang) | ||
* @Update 2016-09-22 1:24:36 pm | ||
* @Update 2016-09-23 11:34:00 pm | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.microStorage=t():e.microStorage=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t){"use strict";function o(e){return function(t,o){if(0!=arguments.length){if(1==arguments.length){var r=JSON.parse(localStorage.getItem(e+"."+t));return r?r.$:r}return localStorage.setItem(e+"."+t,JSON.stringify({$:o})),o}}}o.version="0.0.3",e.exports=o}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.microStorage=t():e.microStorage=t()}(this,function(){return function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t){"use strict";function o(e){return storage.remove=function(t){localStorage.removeItem(e+"."+t)},function(t,o){if(0!=arguments.length){if(1==arguments.length){var r=JSON.parse(localStorage.getItem(e+"."+t));return r?r.$:r}return localStorage.setItem(e+"."+t,JSON.stringify({$:o})),o}}}o.version="0.0.4",e.exports=o}])}); |
{ | ||
"name": "micro-storage", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "(<1kb) A lite localStorage plugin with namespace", | ||
@@ -5,0 +5,0 @@ "main": "dist/micro-storage.min.js", |
@@ -30,4 +30,9 @@ # micro-storage | ||
#### RemoveItem | ||
``` | ||
example.remove('myKey'); | ||
``` | ||
## License | ||
MIT |
@@ -10,2 +10,9 @@ microStorage.version = '@VERSION'; | ||
/** | ||
* Remove value from storage | ||
* @param {String} name key | ||
*/ | ||
storage.remove = function ( name ) { | ||
localStorage.removeItem(`${ namespace }.${ name }`); | ||
}; | ||
/** | ||
* Get or set value from storage | ||
@@ -26,5 +33,5 @@ * @param {String} name key | ||
return value; | ||
} | ||
}; | ||
} | ||
module.exports = microStorage; |
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
16980
349
38