mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
chore: Use .includes and .startsWith, not .indexOf (#7936)
Easier to read than the diverse collection of `=== 0` and `!== -1` and `> -1` tests.
This commit is contained in:
@@ -89,8 +89,7 @@ function workspaceToSvg_(workspace, callback, customCss) {
|
||||
const css = [].slice
|
||||
.call(document.head.querySelectorAll('style'))
|
||||
.filter(
|
||||
(el) =>
|
||||
/\.blocklySvg/.test(el.innerText) || el.id.indexOf('blockly-') === 0,
|
||||
(el) => /\.blocklySvg/.test(el.innerText) || el.id.startsWith('blockly-'),
|
||||
)
|
||||
.map((el) => el.innerText)
|
||||
.join('\n');
|
||||
|
||||
Reference in New Issue
Block a user