Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1 to 0.0.2

CHANGELOG.md

29

lib/index.js

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

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

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

}
updateLength();
}

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

}
updateLength();
}

@@ -60,12 +69,14 @@ function setItem(name, value) {

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

@@ -18,3 +18,4 @@ "typings": "lib/index.d.ts",

"build": "tsc",
"test": "jest"
"test": "jest",
"test:watch": "jest --watchAll"
},

@@ -21,0 +22,0 @@ "jest": {

@@ -5,3 +5,3 @@ # storage-factory

**Warning**: `length` property and array access are not yet implemented. PR welcome 🚀
**Warning**: object access (e.g. `localStorage.foo`) is not yet implemented 💥

@@ -30,1 +30,5 @@ ## Usage

```
## Contribute
Do you want to contribute? Awesome! Please, create an issue first and tell me about it.
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