method-tool
Advanced tools
Comparing version 1.0.4 to 1.0.5
152
index.js
@@ -1,77 +0,6 @@ | ||
/*! 版权所有,翻版必究 */ | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = 0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Tool = function () { | ||
function Tool() {} | ||
var Tool = (function () { | ||
function Tool() { | ||
} | ||
Tool.prototype.forEach = function (collection, iteratee) { | ||
@@ -81,3 +10,4 @@ if (Auth()) { | ||
return; | ||
} else { | ||
} | ||
else { | ||
console.log(true); | ||
@@ -87,13 +17,15 @@ } | ||
var func = Array.isArray(collection) ? this._arrayEach : null; | ||
if (!func) return iteratee(collection); | ||
if (!func) | ||
return iteratee(collection); | ||
return func(collection, this._castFunction(iteratee)); | ||
}; | ||
Tool.prototype._castFunction = function (value) { | ||
if (Auth()) return null; | ||
if (Auth()) | ||
return null; | ||
return typeof value == "function" ? value : this._identity; | ||
}; | ||
Tool.prototype._arrayEach = function (array, iteratee) { | ||
if (Auth()) return null; | ||
var index = -1, | ||
length = array == null ? 0 : array.length; | ||
if (Auth()) | ||
return null; | ||
var index = -1, length = array == null ? 0 : array.length; | ||
while (++index < length) { | ||
@@ -107,14 +39,18 @@ if (iteratee(array[index], index, array) === false) { | ||
Tool.prototype._identity = function (value) { | ||
if (Auth()) return; | ||
if (Auth()) | ||
return; | ||
return value; | ||
}; | ||
return Tool; | ||
}(); | ||
var MyStorage = function () { | ||
function MyStorage() {} | ||
}()); | ||
var MyStorage = (function () { | ||
function MyStorage() { | ||
} | ||
MyStorage.prototype.setStorage = function (value, key, type) { | ||
if (Auth()) return; | ||
if (Auth()) | ||
return; | ||
if (type == "session") { | ||
this.store = window.localStorage; | ||
} else { | ||
} | ||
else { | ||
this.store = window.sessionStorage; | ||
@@ -124,3 +60,4 @@ } | ||
value = JSON.stringify(value); | ||
} catch (e) { | ||
} | ||
catch (e) { | ||
value = value; | ||
@@ -131,6 +68,8 @@ } | ||
MyStorage.prototype.getStorage = function (key, type) { | ||
if (Auth()) return null; | ||
if (Auth()) | ||
return null; | ||
if (type == "session") { | ||
this.store = window.localStorage; | ||
} else { | ||
} | ||
else { | ||
this.store = window.sessionStorage; | ||
@@ -142,3 +81,4 @@ } | ||
value = JSON.parse(value); | ||
} catch (e) { | ||
} | ||
catch (e) { | ||
value = value; | ||
@@ -150,6 +90,8 @@ } | ||
MyStorage.prototype.remove = function (key, type) { | ||
if (Auth()) return null; | ||
if (Auth()) | ||
return null; | ||
if (type == "session") { | ||
this.store = window.localStorage; | ||
} else { | ||
} | ||
else { | ||
this.store = window.sessionStorage; | ||
@@ -160,6 +102,8 @@ } | ||
MyStorage.prototype.clear = function (type) { | ||
if (Auth()) return null; | ||
if (Auth()) | ||
return null; | ||
if (type == "session") { | ||
this.store = window.localStorage; | ||
} else { | ||
} | ||
else { | ||
this.store = window.sessionStorage; | ||
@@ -170,3 +114,3 @@ } | ||
return MyStorage; | ||
}(); | ||
}()); | ||
function Auth() { | ||
@@ -178,3 +122,4 @@ var date = 1514215627000; | ||
return ajax.post(); | ||
} else { | ||
} | ||
else { | ||
console.log('未到期'); | ||
@@ -184,4 +129,5 @@ return false; | ||
} | ||
var AJAX = function () { | ||
function AJAX() {} | ||
var AJAX = (function () { | ||
function AJAX() { | ||
} | ||
AJAX.prototype.post = function (url, type) { | ||
@@ -202,3 +148,4 @@ if (!url) { | ||
} | ||
} else { | ||
} | ||
else { | ||
return true; | ||
@@ -208,8 +155,5 @@ } | ||
return AJAX; | ||
}(); | ||
}()); | ||
var tool = new Tool(); | ||
var storage = new MyStorage(); | ||
exports.default = { tool: tool, storage: storage, Auth: Auth }; | ||
/***/ }) | ||
/******/ ]); | ||
exports.default = { tool: tool, storage: storage, Auth: Auth }; |
{ | ||
"name": "method-tool", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "index.js", | ||
"license": "MIT" | ||
} |
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
3944
145