Use Object Spread Syntax (#7777)

* Use Object Spread Syntax

* Nits
This commit is contained in:
Justin Ridgewell
2018-04-23 21:44:27 -04:00
committed by GitHub
parent 037fee8ffb
commit 2afe9404fe
37 changed files with 263 additions and 70 deletions

View File

@@ -38,12 +38,15 @@ function getMarkerLines(
source: Array<string>,
opts: Object,
): { start: number, end: number, markerLines: Object } {
const startLoc: Location = Object.assign(
{},
{ column: 0, line: -1 },
loc.start,
);
const endLoc: Location = Object.assign({}, startLoc, loc.end);
const startLoc: Location = {
column: 0,
line: -1,
...loc.start,
};
const endLoc: Location = {
...startLoc,
...loc.end,
};
const { linesAbove = 2, linesBelow = 3 } = opts || {};
const startLine = startLoc.line;
const startColumn = startLoc.column;