@atlaspack/codeframe 2.12.1-dev.3450 → 2.12.1-dev.3478

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/codeframe",
3
- "version": "2.12.1-dev.3450+58845ef87",
3
+ "version": "2.12.1-dev.3478+5fd2da535",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -30,5 +30,5 @@
30
30
  "slice-ansi": "^4.0.0",
31
31
  "string-width": "^4.2.0"
32
32
  },
33
- "gitHead": "58845ef87446fcedb7d7d8876440c64184645cbb"
33
+ "gitHead": "5fd2da535ecbe096d57e03aec15e80bb1d7601f7"
34
34
  }
package/src/codeframe.js CHANGED
@@ -85,7 +85,7 @@ export default function codeFrame(
85
85
 
86
86
  // Make columns/lines start at 1
87
87
  let originalHighlights = highlights;
88
- highlights = highlights.map(h => {
88
+ highlights = highlights.map((h) => {
89
89
  return {
90
90
  start: {
91
91
  column: h.start.column - 1,
@@ -116,13 +116,13 @@ export default function codeFrame(
116
116
  let tail;
117
117
  if (endLineIndex - startLine > opts.maxLines) {
118
118
  let maxLine = startLine + opts.maxLines - 1;
119
- highlights = highlights.filter(h => h.start.line < maxLine);
119
+ highlights = highlights.filter((h) => h.start.line < maxLine);
120
120
  lastHighlight = highlights[0];
121
121
  endLineIndex = Math.min(
122
122
  maxLine,
123
123
  lastHighlight.end.line + opts.padding.after,
124
124
  );
125
- tail = originalHighlights.filter(h => h.start.line > endLineIndex);
125
+ tail = originalHighlights.filter((h) => h.start.line > endLineIndex);
126
126
  }
127
127
 
128
128
  let lineNumberLength = (endLineIndex + 1).toString(10).length;
@@ -148,7 +148,7 @@ export default function codeFrame(
148
148
  // Find highlights that need to get rendered on the current line
149
149
  let lineHighlights = highlights
150
150
  .filter(
151
- highlight =>
151
+ (highlight) =>
152
152
  highlight.start.line <= currentLineIndex &&
153
153
  highlight.end.line >= currentLineIndex,
154
154
  )
@@ -162,7 +162,7 @@ export default function codeFrame(
162
162
  let isWholeLine =
163
163
  lineHighlights.length &&
164
164
  !!lineHighlights.find(
165
- h => h.start.line < currentLineIndex && h.end.line > currentLineIndex,
165
+ (h) => h.start.line < currentLineIndex && h.end.line > currentLineIndex,
166
166
  );
167
167
 
168
168
  let lineLengthLimit =