Replace lodash 'extend' usage with Object.assign (#11812)

This commit is contained in:
James Addison 2020-07-09 15:04:48 +01:00 committed by GitHub
parent bff6298578
commit aae1862170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,5 @@
import cloneDeep from "lodash/cloneDeep";
import clone from "lodash/clone";
import extend from "lodash/extend";
import semver from "semver";
import path from "path";
import fs from "fs";
@ -119,7 +118,7 @@ function pushTask(taskName, taskDir, suite, suiteName) {
const taskOpts = cloneDeep(suite.options);
const taskOptsLoc = tryResolve(taskDir + "/options");
if (taskOptsLoc) extend(taskOpts, require(taskOptsLoc));
if (taskOptsLoc) Object.assign(taskOpts, require(taskOptsLoc));
const test = {
optionsDir: taskOptsLoc ? path.dirname(taskOptsLoc) : null,

View File

@ -7,7 +7,6 @@ import { codeFrameColumns } from "@babel/code-frame";
import defaults from "lodash/defaults";
import escapeRegExp from "lodash/escapeRegExp";
import * as helpers from "./helpers";
import extend from "lodash/extend";
import merge from "lodash/merge";
import resolve from "resolve";
import assert from "assert";
@ -380,7 +379,7 @@ export default function (
sourceMap: !!(task.sourceMappings || task.sourceMap),
});
extend(task.options, taskOpts);
Object.assign(task.options, taskOpts);
if (dynamicOpts) dynamicOpts(task.options, task);