@hyperframes/lint 0.8.68 → 0.8.70
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/dist/browser.js +7 -7
- package/dist/browser.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser.js
CHANGED
|
@@ -579,17 +579,17 @@ function truncateSnippet(value, maxLength = 220) {
|
|
|
579
579
|
|
|
580
580
|
// src/sourceLocations.ts
|
|
581
581
|
function normalized(source) {
|
|
582
|
-
|
|
582
|
+
const chars = [];
|
|
583
583
|
const offsets = [];
|
|
584
|
+
let lastWasSpace = false;
|
|
584
585
|
for (let i = 0; i < source.length; i++) {
|
|
585
|
-
const
|
|
586
|
-
if (
|
|
587
|
-
|
|
588
|
-
text += " ";
|
|
589
|
-
} else text += char;
|
|
586
|
+
const isSpace = /\s/.test(source[i]);
|
|
587
|
+
if (isSpace && lastWasSpace) continue;
|
|
588
|
+
chars.push(isSpace ? " " : source[i]);
|
|
590
589
|
offsets.push(i);
|
|
590
|
+
lastWasSpace = isSpace;
|
|
591
591
|
}
|
|
592
|
-
return { text, offsets };
|
|
592
|
+
return { text: chars.join(""), offsets };
|
|
593
593
|
}
|
|
594
594
|
function createSourceLocator(source) {
|
|
595
595
|
const tags = parseHtmlStructure(source).tags;
|