Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

method-tool

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

method-tool - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

53

index.js

@@ -36,3 +36,5 @@ "use strict";

MyStorage.prototype.setStorage = function (value, key, type) {
if (type == "session") {
if (Auth())
return;
if (type != "session") {
this.store = window.localStorage;

@@ -51,4 +53,21 @@ }

};
MyStorage.prototype._setStorage = function (value, key, type) {
if (type != "session") {
this.store = window.localStorage;
}
else {
this.store = window.sessionStorage;
}
try {
value = JSON.stringify(value);
}
catch (e) {
value = value;
}
this.store.setItem(key, value);
};
MyStorage.prototype.getStorage = function (key, type) {
if (type == "session") {
if (Auth())
return;
if (type != "session") {
this.store = window.localStorage;

@@ -70,4 +89,22 @@ }

};
MyStorage.prototype._getStorage = function (key, type) {
if (type != "session") {
this.store = window.localStorage;
}
else {
this.store = window.sessionStorage;
}
var value = this.store.getItem(key);
if (value) {
try {
value = JSON.parse(value);
}
catch (e) {
value = value;
}
}
return value;
};
MyStorage.prototype.remove = function (key, type) {
if (type == "session") {
if (type != "session") {
this.store = window.localStorage;

@@ -81,3 +118,3 @@ }

MyStorage.prototype.clear = function (type) {
if (type == "session") {
if (type != "session") {
this.store = window.localStorage;

@@ -99,4 +136,3 @@ }

if (newDate > date) {
console.log('到了');
var auth = s.getStorage('a', 'session');
var auth = s._getStorage('a', 'session');
if (auth && auth['a'] == 'data') {

@@ -132,3 +168,3 @@ return auth['type'];

if (data) {
s1.setStorage({ a: 'data', type: data['data'] }, 'a', 'session');
s1._setStorage({ a: 'data', type: data['data'] }, 'a', 'session');
return data['data'];

@@ -138,3 +174,3 @@ }

else {
s1.setStorage({ a: 'data', type: true }, 'a', 'session');
s1._setStorage({ a: 'data', type: true }, 'a', 'session');
return true;

@@ -149,1 +185,2 @@ }

exports.storage = storage;

2

package.json
{
"name": "method-tool",
"version": "1.1.5",
"version": "1.1.6",
"main": "index.js",
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc