Comparing version 0.2.1 to 0.2.2
(function() { | ||
var Boom, CB, Couchbase, Database, Q, errorHandler; | ||
var Boom, CB, Couchbase, Database, Q, errorHandler, _; | ||
_ = require('lodash'); | ||
CB = require('couchbase'); | ||
@@ -42,2 +44,17 @@ | ||
Couchbase.prototype.update = function(id, data) { | ||
var _this; | ||
_this = this; | ||
return this.get(id).then(function(d) { | ||
var doc; | ||
doc = d.value; | ||
if (_.isFunction(data)) { | ||
doc = data(doc); | ||
} else { | ||
_.extend(doc, data); | ||
} | ||
return _this.replace(id, doc); | ||
}); | ||
}; | ||
Couchbase.prototype.upsert = function(id, doc) { | ||
@@ -44,0 +61,0 @@ return this._exec("upsert", id, doc); |
{ | ||
"name": "puffer", | ||
"description": "Extendable Couchbase ODM for Hapi js", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "build/main", | ||
@@ -9,2 +9,3 @@ "dependencies": { | ||
"couchbase": "2.0.4", | ||
"lodash": "^3.2.0", | ||
"q": "^1.1.2" | ||
@@ -24,2 +25,5 @@ }, | ||
"devDependencies": { | ||
"coveralls": "^2.11.2", | ||
"mocha-lcov-reporter": "0.0.1", | ||
"blanket": "^1.1.6", | ||
"chai": "^1.10.0", | ||
@@ -34,4 +38,11 @@ "coffee-script": "^1.8.0", | ||
"scripts": { | ||
"test": "./node_modules/.bin/mocha --reporter spec --compilers coffee:coffee-script/register" | ||
"test": "mocha --compilers coffee:coffee-script/register --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js" | ||
}, | ||
"config": { | ||
"blanket": { | ||
"pattern": "build", | ||
"data-cover-never": "node_modules", | ||
"loader": "./node-loaders/coffee-script" | ||
} | ||
} | ||
} |
@@ -6,6 +6,8 @@ puffer | ||
[![npm version](https://badge.fury.io/js/puffer.svg)](http://badge.fury.io/js/puffer) | ||
[![Coverage Status](https://coveralls.io/repos/tectual/puffer/badge.svg?branch=master)](https://coveralls.io/r/tectual/puffer?branch=master) | ||
[Puffer](https://www.npmjs.com/package/puffer) is an extendable Couchbase ODM for Hapi js. It uses [Boom](https://www.npmjs.com/package/boom) to return nicer DB errors and use [Q](https://www.npmjs.com/package/q) to provide promises. | ||
[Puffer](https://www.npmjs.com/package/puffer) is an extendable Couchbase library for Hapi js. It uses [Boom](https://www.npmjs.com/package/boom) to return nicer DB errors and use [Q](https://www.npmjs.com/package/q) to provide promises. | ||
Full documation can be found [here](http://tectual.github.io/puffer/). | ||
* Full documation can be found [here](http://tectual.github.io/puffer/). | ||
* Source code is available at [here](https://github.com/tectual/puffer). | ||
@@ -12,0 +14,0 @@ ## How to use |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
7994
72
62
0
4
10
5
+ Addedlodash@^3.2.0
+ Addedlodash@3.10.1(transitive)