@atlaspack/codeframe 2.12.1-dev.3450 → 2.12.1-dev.3460
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/lib/codeframe.js.map +1 -1
- package/package.json +2 -2
- package/src/codeframe.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/codeframe",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3460+340817991",
|
|
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": "
|
|
33
|
+
"gitHead": "3408179911d6c67e2bdad99e545dd7a0a9a6782c"
|
|
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 =
|