Skip to content

Commit 631f555

Browse files
authored
fix: use lodash _baseIsNative directly instead of _.isNative (#12358) (#12475) (#12480)
1 parent 5cabcbc commit 631f555

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const DataTypes = require('./data-types');
44
const SqlString = require('./sql-string');
55
const _ = require('lodash');
6+
const baseIsNative = require('lodash/_baseIsNative');
67
const uuidv1 = require('uuid').v1;
78
const uuidv4 = require('uuid').v4;
89
const operators = require('./operators');
@@ -51,7 +52,9 @@ function mergeDefaults(a, b) {
5152
return _.mergeWith(a, b, (objectValue, sourceValue) => {
5253
// If it's an object, let _ handle it this time, we will be called again for each property
5354
if (!_.isPlainObject(objectValue) && objectValue !== undefined) {
54-
if (_.isFunction(objectValue) && _.isNative(objectValue)) {
55+
// _.isNative includes a check for core-js and throws an error if present.
56+
// Depending on _baseIsNative bypasses the core-js check.
57+
if (_.isFunction(objectValue) && baseIsNative(objectValue)) {
5558
return sourceValue || objectValue;
5659
}
5760
return objectValue;

0 commit comments

Comments
 (0)