Skip to content

Commit

Permalink
replace merge with object spread
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo committed Mar 26, 2021
1 parent 8a999b1 commit 6bff19c
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions packages/babel-helper-transform-fixture-test-runner/src/index.ts
Expand Up @@ -8,7 +8,6 @@ import {
import sourceMap from "source-map";
import { codeFrameColumns } from "@babel/code-frame";
import * as helpers from "./helpers";
import merge from "lodash/merge";
import assert from "assert";
import fs from "fs";
import path from "path";
Expand Down Expand Up @@ -200,19 +199,17 @@ function run(task) {

// todo(flow->ts) add proper return type (added any, because empty object is inferred)
function getOpts(self): any {
const newOpts = merge(
{
ast: true,
cwd: path.dirname(self.loc),
filename: self.loc,
filenameRelative: self.filename,
sourceFileName: self.filename,
sourceType: "script",
babelrc: false,
inputSourceMap: task.inputSourceMap || undefined,
},
opts,
);
const newOpts = {
ast: true,
cwd: path.dirname(self.loc),
filename: self.loc,
filenameRelative: self.filename,
sourceFileName: self.filename,
sourceType: "script",
babelrc: false,
inputSourceMap: task.inputSourceMap || undefined,
...opts,
};

return resolveOptionPluginOrPreset(newOpts, optionsDir);
}
Expand Down

0 comments on commit 6bff19c

Please sign in to comment.