我正在尝试使用 lodash merge 合并两个对象,但它不适用于符号。有没有替代的实用程序?
import {merge} from 'lodash';
import {Op} from 'sequelize';
const selectA = {
where: {
text: "something"
}
};
const selectB = {
where: {
date_from: {
[Op.lt]: Sequelize.literal('NOW()')
}
}
};
console.log(_.merge(selectA, selectB));
Run Code Online (Sandbox Code Playgroud)
输出:
{ where: { text: 'something', date_from: {} } }
Run Code Online (Sandbox Code Playgroud)