Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use lodash _baseIsNative directly instead of _.isNative (#12358) #12475

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,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 @@ -49,7 +50,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