diff --git a/lib/utils.js b/lib/utils.js index 4299619bac0e..0ce6466ea304 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -3,6 +3,7 @@ const DataTypes = require('./data-types'); const SqlString = require('./sql-string'); const _ = require('lodash'); +const baseIsNative = require('lodash/_baseIsNative'); const uuidv1 = require('uuid').v1; const uuidv4 = require('uuid').v4; const operators = require('./operators'); @@ -51,7 +52,9 @@ function mergeDefaults(a, b) { return _.mergeWith(a, b, (objectValue, sourceValue) => { // If it's an object, let _ handle it this time, we will be called again for each property if (!_.isPlainObject(objectValue) && objectValue !== undefined) { - if (_.isFunction(objectValue) && _.isNative(objectValue)) { + // _.isNative includes a check for core-js and throws an error if present. + // Depending on _baseIsNative bypasses the core-js check. + if (_.isFunction(objectValue) && baseIsNative(objectValue)) { return sourceValue || objectValue; } return objectValue;