Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Oct 1, 2016
1 parent 49b4a18 commit 11c3dfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion dist/underscore-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ module.exports = {
getById: function(collection, id) {
var self = this;
return this.find(collection, function(doc) {
return doc[self.__id()] === id;
if (doc.hasOwnProperty(self.__id())) {
return doc[self.__id()].toString() === id.toString();
}
});
},

Expand Down
4 changes: 2 additions & 2 deletions dist/underscore-db.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "underscore-db",
"version": "0.11.0",
"version": "0.12.0",
"description": "Use JavaScript objects as databases",
"main": "src/node.js",
"scripts": {
"test": "grunt test",
"prepublish": "grunt"
"build": "grunt",
"prepush": "npm test",
"prepublish": "npm run build"
},
"author": "Typicode <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -33,6 +35,7 @@
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "~0.5.3",
"grunt-mocha-test": "~0.7.0",
"husky": "^0.11.8",
"lodash": "^4.6.1",
"sinon": "~1.8.1",
"underscore": "^1.8.3"
Expand Down

0 comments on commit 11c3dfa

Please sign in to comment.