effects-as-data-mongo
Advanced tools
Comparing version 1.3.2 to 2.0.0
{ | ||
"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: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
177
6360
6