Comparing version 5.3.0 to 5.3.1
@@ -37,2 +37,8 @@ 'use strict'; | ||
if (Array.isArray(id)) { | ||
for (let i = 0; i < id.length; ++i) { | ||
if (id[i].toString().length > 127) { | ||
return this._error('get', 'Invalid id length', id, Hoek.nextTick(callback)); | ||
} | ||
} | ||
this._run(this._table.getAll(RethinkDB.args(id)), 'get', id, callback); | ||
@@ -42,2 +48,6 @@ return; | ||
if (id.toString().length > 127) { | ||
return this._error('get', 'Invalid id length', id, Hoek.nextTick(callback)); | ||
} | ||
this._run(this._table.get(id), 'get', id, callback); | ||
@@ -44,0 +54,0 @@ } |
{ | ||
"name": "penseur", | ||
"description": "Lightweight RethinkDB wrapper", | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
@@ -16,3 +16,3 @@ "repository": "git://github.com/hueniverse/penseur", | ||
"boom": "3.x.x", | ||
"hoek": "3.x.x", | ||
"hoek": "4.x.x", | ||
"items": "2.x.x", | ||
@@ -19,0 +19,0 @@ "joi": "8.x.x", |
@@ -165,2 +165,30 @@ 'use strict'; | ||
}); | ||
it('errors on invalid id', (done) => { | ||
const db = new Penseur.Db('penseurtest'); | ||
db.establish(['test'], (err) => { | ||
expect(err).to.not.exist(); | ||
db.test.get('0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', (err, result) => { | ||
expect(err).to.exist(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it('errors on invalid ids', (done) => { | ||
const db = new Penseur.Db('penseurtest'); | ||
db.establish(['test'], (err) => { | ||
expect(err).to.not.exist(); | ||
db.test.get(['0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'], (err, result) => { | ||
expect(err).to.exist(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -167,0 +195,0 @@ |
179347
4288
- Removedhoek@3.0.4(transitive)
Updatedhoek@4.x.x