Skip to content

Commit

Permalink
fix: use lodash _baseIsNative directly instead of _.isNative (#12358) (
Browse files Browse the repository at this point in the history
  • Loading branch information
tpodom committed Jul 10, 2020
1 parent 5cabcbc commit 631f555
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils.js
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 631f555

Please sign in to comment.