New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

monk

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monk - npm Package Compare versions

Comparing version

to
0.1.4

6

History.md
0.1.4 / 2012-05-06
==================
* Ensured insert calls back with a single object.
* Ensured `insert` resolves promise in next tick.
0.1.3 / 2012-05-03

@@ -3,0 +9,0 @@ ==================

6

lib/collection.js

@@ -262,3 +262,7 @@

debug('%s insert "%j"', this.name, data);
this.col.insert(data, util.options(opts), promise.fulfill);
this.col.insert(data, util.options(opts), function (err, docs) {
process.nextTick(function () {
promise.fulfill.call(promise, err, docs ? docs[0] : docs);
});
});

@@ -265,0 +269,0 @@ return promise;

2

package.json
{
"name": "monk"
, "version": "0.1.3"
, "version": "0.1.4"
, "main": "lib/monk.js"

@@ -5,0 +5,0 @@ , "dependencies": {

@@ -81,2 +81,17 @@

describe('inserting', function () {
it('should force callback in next tick', function (done) {
var p = users.insert({ a: 'b' });
p.complete(done);
});
it('should give you an object with the _id', function (done) {
var p = users.insert({ a: 'b' }, function (err, obj) {
expect(obj._id).to.be.an('object');
expect(obj._id.toHexString).to.not.be(undefined);
done();
});
});
});
describe('promises', function () {

@@ -83,0 +98,0 @@ var Promise = monk.Promise;