diff --git a/.travis.yml b/.travis.yml index 211acae..b7bcc3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ language: node_js node_js: - - "6.14.2" + - "6.14.4" + - "8.16.0" + - "10.15.3" + - "12.2.0" diff --git a/objectid.js b/objectid.js index 4307a2d..c05a2af 100644 --- a/objectid.js +++ b/objectid.js @@ -211,12 +211,14 @@ function buffer(str) { return out; } +var inspect = (Symbol && Symbol.for('nodejs.util.inspect.custom')) || 'inspect'; + /** * Converts to a string representation of this Id. * * @return {String} return the 24 byte hex string representation. * @api private */ -ObjectID.prototype.inspect = function() { return "ObjectID("+this+")" }; +ObjectID.prototype[inspect] = function() { return "ObjectID("+this+")" }; ObjectID.prototype.toJSON = ObjectID.prototype.toHexString; ObjectID.prototype.toString = ObjectID.prototype.toHexString; diff --git a/package.json b/package.json index 72eec60..c7658ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bson-objectid", - "version": "1.2.4", + "version": "1.2.5", "description": "Construct ObjectIDs without the mongodb driver or bson module", "main": "objectid.js", "typings": "./objectid.d.ts",