tida
Version:
tida
2 lines (1 loc) • 1.99 kB
JavaScript
module.exports=webpackJsonp([12],{51:function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(1),a={};l.isWeex?a=n(52):"undefined"!=typeof localStorage&&null!==localStorage&&(a=localStorage);var i=function(){function e(){o(this,e)}return u(e,null,[{key:"getItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};if(a.getItem)if(l.isWeex)a.getItem(e,t);else{var n=a.getItem(e);t({data:n||"undefined",result:"success"})}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};a.setItem&&(l.isWeex?a.setItem(e,t,n):(a.setItem(e,t),n({data:void 0,result:"success"})))}},{key:"removeItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};a.removeItem&&(l.isWeex?a.removeItem(e,t):(a.removeItem(e),t({data:void 0,result:"success"})))}},{key:"getAllKeys",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};a.length&&(l.isWeex?a.getAllKeys(e):e({data:Object.keys(a),result:"success"}))}},{key:"clear",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.getAllKeys(function(t){e.multiRemove(t.data)})}},{key:"multiRemove",value:function(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.forEach(function(t){e.removeItem(t)})}},{key:"sLength",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};a.length&&(l.isWeex?a.length(e):e({data:a.length,result:"success"}))}}]),e}();t.default=i,e.exports=t.default},52:function(e,t){e.exports=require("@weex-module/storage")}},[51]);