New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

storage-factory

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storage-factory - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 0.0.3
* Update development dependencies
# 0.0.2

@@ -2,0 +6,0 @@

28

lib/index.js

@@ -5,10 +5,2 @@ "use strict";

let inMemoryStorage = {};
const def = {
getItem,
setItem,
removeItem,
clear,
key,
length: 0
};
function isSupported() {

@@ -32,3 +24,2 @@ try {

}
updateLength();
}

@@ -59,3 +50,2 @@ function getItem(name) {

}
updateLength();
}

@@ -69,14 +59,22 @@ function setItem(name, value) {

}
updateLength();
}
function updateLength() {
function length() {
if (isSupported()) {
def.length = storage.length;
return storage.length;
}
else {
def.length = Object.keys(inMemoryStorage).length;
return Object.keys(inMemoryStorage).length;
}
}
return def;
return {
getItem,
setItem,
removeItem,
clear,
key,
get length() {
return length();
},
};
}
exports.storageFactory = storageFactory;
{
"name": "storage-factory",
"version": "0.0.2",
"version": "0.0.3",
"main": "lib/index.js",

@@ -10,6 +10,7 @@ "typings": "lib/index.d.ts",

"devDependencies": {
"@types/jest": "^23.3.2",
"@types/jest": "^23.3.9",
"jest": "^23.6.0",
"ts-jest": "^23.10.2",
"typescript": "^3.0.3"
"prettier": "1.14.3",
"ts-jest": "^23.10.5",
"typescript": "^3.1.6"
},

@@ -20,3 +21,4 @@ "scripts": {

"test": "jest",
"test:watch": "jest --watchAll"
"test:watch": "jest --watchAll",
"format": "prettier --write src/*.ts"
},

@@ -33,2 +35,5 @@ "jest": {

},
"prettier": {
"trailingComma": "es5"
},
"keywords": [],

@@ -35,0 +40,0 @@ "author": "Michal Zalecki <michal@michalzalecki.com>",

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