Replace lodash 'clone' usage with ES6 Spread initializer (#11811)

This commit is contained in:
James Addison 2020-07-09 16:32:04 +01:00 committed by GitHub
parent aae1862170
commit 55ce749f42
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,5 +1,4 @@
import cloneDeep from "lodash/cloneDeep";
import clone from "lodash/clone";
import semver from "semver";
import path from "path";
import fs from "fs";
@ -262,7 +261,7 @@ export default function get(entryLoc): Array<Suite> {
if (shouldIgnore(suiteName)) continue;
const suite = {
options: clone(rootOpts),
options: { ...rootOpts },
tests: [],
title: humanize(suiteName),
filename: entryLoc + "/" + suiteName,

View File

@ -1,6 +1,5 @@
import * as virtualTypes from "./path/lib/virtual-types";
import * as t from "@babel/types";
import clone from "lodash/clone";
/**
* explode() will take a visitor object with all of the various shorthands
@ -106,7 +105,7 @@ export function explode(visitor) {
if (existing) {
mergePair(existing, fns);
} else {
visitor[alias] = clone(fns);
visitor[alias] = { ...fns };
}
}
}