Skip to content

Commit 7c465f3

Browse files
committed
handle object keys
1 parent 322519a commit 7c465f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/bst.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ BinarySearchTree.prototype.insert = function (key, value) {
214214
// Same key as root
215215
if (this.compareKeys(this.key, key) === 0) {
216216
if (this.unique) {
217-
var err = new Error("Can't insert key " + key + ", it violates the unique constraint");
217+
var err = new Error("Can't insert key " + JSON.stringify(key) + ", it violates the unique constraint");
218218
err.key = key;
219219
err.errorType = 'uniqueViolated';
220220
throw err;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rmanibus/binary-search-tree",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"author": {
55
"name": "Louis Chatriot",
66
"email": "louis.chatriot@gmail.com"

0 commit comments

Comments
 (0)