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

dirty-store

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dirty-store - npm Package Compare versions

Comparing version 0.0.1 to 0.0.3

5

index.js

@@ -30,2 +30,4 @@ /**

*/
var util = require('util');
var store = {

@@ -63,3 +65,3 @@ // Initialise the store.

// Only store primitive types
if (typeof val === "object") return this;
if (typeof val === "object" && !util.isArray(val)) return this;
// Regular set

@@ -81,2 +83,3 @@ this._[id] = val;

return Object.keys(this._).reduce(function (memo, key) {
if (typeof this._[key] === "undefined") return memo;
memo[key] = (this._[key].toObject ? this._[key].toObject() : this._[key]);

@@ -83,0 +86,0 @@ return memo;

2

package.json
{
"name": "dirty-store",
"version": "0.0.1",
"version": "0.0.3",
"description": "A quick and dirty, nestable store that converts well to a native JS object.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,6 @@ # dirty-store

```shell
npm install dirty-store
```
## example

@@ -7,0 +11,0 @@

@@ -28,2 +28,11 @@ var t = require('tap');

t.test('set array', function (t) {
st.set('d', [1, 2, 3]);
t.ok(st._.d, 'd is set');
t.equal(st._.d[0], 1, 'd has the correct value');
t.equal(st._.d[1], 2, 'd has the correct value');
t.equal(st._.d[2], 3, 'd has the correct value');
t.end();
});
});

@@ -30,0 +39,0 @@

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