diff --git a/.travis.yml b/.travis.yml index 2cf1e4a1..70df5221 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,6 @@ language: node_js node_js: - "8" - "10" + - "12" after_success: npm run coverage diff --git a/lib/date-string.js b/lib/date-string.js index 905dc5ad..09a0bee1 100644 --- a/lib/date-string.js +++ b/lib/date-string.js @@ -97,3 +97,10 @@ DateString.prototype.inspect = function(depth, options) { _date: this._date, }); }; + +if (inspect.custom) { + // Node.js 12+ no longer recognizes "inspect" method, + // it uses "inspect.custom" symbol as the key instead + // TODO(semver-major) always use the symbol key only (requires Node.js 8+). + DateString.prototype[inspect.custom] = DateString.prototype.inspect; +} diff --git a/lib/model-utils.js b/lib/model-utils.js index a83974f6..da5c3286 100644 --- a/lib/model-utils.js +++ b/lib/model-utils.js @@ -389,6 +389,8 @@ ModelUtils._coerce = function(where, options) { self._coerce(clauses[k], options); } + where[p] = clauses; + continue; } let DataType = props[p] && props[p].type; diff --git a/lib/model.js b/lib/model.js index 5b2bc33e..de874e2b 100644 --- a/lib/model.js +++ b/lib/model.js @@ -637,6 +637,13 @@ ModelBaseClass.prototype.inspect = function(depth) { }); }; +if (util.inspect.custom) { + // Node.js 12+ no longer recognizes "inspect" method, + // it uses "inspect.custom" symbol as the key instead + // TODO(semver-major) always use the symbol key only (requires Node.js 8+). + ModelBaseClass.prototype[util.inspect.custom] = ModelBaseClass.prototype.inspect; +} + /** * * @param {String} anotherClass could be string or class. Name of the class or the class itself