@hyperframes/lint 0.8.68 → 0.8.69
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/index.js
CHANGED
|
@@ -582,17 +582,17 @@ function mediaSrcTagRe(tagAlternation) {
|
|
|
582
582
|
|
|
583
583
|
// src/sourceLocations.ts
|
|
584
584
|
function normalized(source) {
|
|
585
|
-
|
|
585
|
+
const chars = [];
|
|
586
586
|
const offsets = [];
|
|
587
|
+
let lastWasSpace = false;
|
|
587
588
|
for (let i = 0; i < source.length; i++) {
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
-
text += " ";
|
|
592
|
-
} else text += char;
|
|
589
|
+
const isSpace = /\s/.test(source[i]);
|
|
590
|
+
if (isSpace && lastWasSpace) continue;
|
|
591
|
+
chars.push(isSpace ? " " : source[i]);
|
|
593
592
|
offsets.push(i);
|
|
593
|
+
lastWasSpace = isSpace;
|
|
594
594
|
}
|
|
595
|
-
return { text, offsets };
|
|
595
|
+
return { text: chars.join(""), offsets };
|
|
596
596
|
}
|
|
597
597
|
function createSourceLocator(source) {
|
|
598
598
|
const tags = parseHtmlStructure(source).tags;
|