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

bamboo

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bamboo - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

HISTORY.md

@@ -0,1 +1,5 @@

# 0.1.1 (2014-10-30)
* allow for extra response option from sync for .find
# 0.1.0 (2014-10-26)

@@ -2,0 +6,0 @@

4

model.js

@@ -381,3 +381,3 @@ var Emitter = require('emitter');

sync(sync_opt, function(err, result) {
sync(sync_opt, function(err, result, response) {
if (err) {

@@ -387,3 +387,3 @@ return cb(err);

return cb(null, result.map(Construct));
return cb(null, result.map(Construct), response);
});

@@ -390,0 +390,0 @@ };

{
"name": "bamboo",
"version": "0.1.0",
"version": "0.1.1",
"author": "Roman Shtylman <shtylman@gmail.com>",

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

@@ -50,2 +50,23 @@ var assert = require('assert');

test('should update on fetch', function(done) {
function sync(opt, cb) {
assert.equal(opt.method, 'GET');
assert.equal(opt.url, '/posts/12345');
assert.equal(opt.query, undefined);
cb(null, {
title: 'hello world'
});
};
var post = Post.extend({}, { sync: sync })();
post.id = '12345';
post.title = 'test';
post.fetch(function(err) {
assert.ifError(err);
assert.equal(post.id, 12345);
assert.equal(post.title, 'hello world');
done();
});
});
test('destroy', function(done) {

@@ -76,1 +97,32 @@ function sync(opt, cb) {

})
test('should pass the response back for .find', function(done) {
function sync(opt, cb) {
assert.equal(opt.method, 'GET');
assert.equal(opt.url, '/posts');
var posts = [{
id: '1',
title: 'Hello World'
}, {
id: '2',
title: 'Magic Beans'
}];
var res = {
body: posts,
headers: {
foo: 'bar'
}
}
cb(null, posts, res);
};
var NewPost = Post.extend({}, { sync: sync });
NewPost.find(function(err, posts, res) {
assert.ifError(err);
assert.equal(posts.length, 2);
done();
});
});
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