Socket
Socket
Sign inDemoInstall

effects-as-data-mongo

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

effects-as-data-mongo - npm Package Compare versions

Comparing version 1.3.2 to 2.0.0

8

package.json
{
"name": "effects-as-data-mongo",
"version": "1.3.2",
"version": "2.0.0",
"description": "Effects-as-data for mongo",

@@ -12,6 +12,3 @@ "main": "src/index.js",

"test": "jest",
"precommit": "npm test && uver && git add -A",
"deploy": "npm test",
"publish-please": "publish-please",
"prepublish": "publish-please guard"
"deploy": "npm test && npm publish"
},

@@ -29,3 +26,2 @@ "author": "orourkedd",

"jest-cli": "^17.0.3",
"publish-please": "^2.2.0",
"sinon": "^1.17.7",

@@ -32,0 +28,0 @@ "uver-cli": "^1.1.0"

@@ -5,2 +5,7 @@ const { curry } = require('ramda');

const unwrap = (r) => {
if (r.success) return r.payload
else throw r.error
}
function mongoHandler(mongo, action) {

@@ -13,3 +18,3 @@ let collection;

collection = mongo.collection(action.collection);
return safecb(collection.insert, collection)(action.doc);
return safecb(collection.insert, collection)(action.doc).then(unwrap)

@@ -22,7 +27,7 @@ case 'upsert':

multi: false
});
}).then(unwrap)
case 'findOne':
collection = mongo.collection(action.collection);
return safecb(collection.findOne, collection)(action.query);
return safecb(collection.findOne, collection)(action.query).then(unwrap)

@@ -57,3 +62,3 @@ case 'find':

collection = mongo.collection(action.collection);
return safecb(collection.drop, collection)();
return safecb(collection.drop, collection)().then(unwrap)

@@ -60,0 +65,0 @@ default:

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