Skip to content

Commit b10349d

Browse files
(chore) replace deprecated String.prototype.substr() (#283)
1 parent d918675 commit b10349d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/snipTagContent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function snipScriptAndStyleTagContent(source: string): string {
1616
const indexes: [number, number][] = [];
1717
let match = null;
1818
while ((match = regex.exec(source)) != null) {
19-
if (!source.substr(match.index, 10).startsWith('<!--')) {
19+
if (source.slice(match.index, match.index + 4) !== '<!--') {
2020
indexes.push([match.index, regex.lastIndex]);
2121
}
2222
}

0 commit comments

Comments
 (0)