Skip to content

Commit 461d1da

Browse files
committed
ci(biome): template literals are preferred over string concatenation
1 parent 1939779 commit 461d1da

19 files changed

+24
-24
lines changed

docs/javascripts/fill.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function init(path) {
5151
toc.id = "toc";
5252
const ttoc = document.createElement("h3");
5353
toc.appendChild(ttoc);
54-
ttoc.textContent = "Examples (" + index.length + ")";
54+
ttoc.textContent = `Examples·(${index.length})`;
5555
const ul = document.createElement("ul");
5656
toc.appendChild(ul);
5757
let i;
@@ -70,7 +70,7 @@ async function init(path) {
7070
for (j = 0; j < index.length; j++) {
7171
loading.textContent += ".";
7272
content.push(document.createElement("hr"));
73-
console.debug("Adding " + index[j].name);
73+
console.debug(`Adding·${index[j].name}`);
7474
const bookmarklet = document.createElement("section");
7575
content.push(bookmarklet);
7676
bookmarklet.className = "bookmarklet";
@@ -87,7 +87,7 @@ async function init(path) {
8787
const description = document.createElement("p");
8888
bookmarklet.appendChild(description);
8989
description.textContent = index[j].description;
90-
console.debug("Fetching source code for " + index[j].name);
90+
console.debug(`Fetching·source·code·for·${index[j].name}`);
9191
const js = await fetch(
9292
"https://raw.githubusercontent.com/" +
9393
path +
@@ -97,7 +97,7 @@ async function init(path) {
9797
)
9898
.then((response) => response.text())
9999
.catch(console.error);
100-
console.debug("Fetched source code for " + index[j].name);
100+
console.debug(`Fetched·source·code·for·${index[j].name}`);
101101
const book = document.createElement("h4");
102102
bookmarklet.appendChild(book);
103103
book.textContent = "Bookmarklet";

javascripts/Amazon - Search selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (selection === undefined || selection.length === 0) {
99
} else {
1010
window
1111
.open(
12-
"https://www.amazon.com/s?k=" + encodeURIComponent(selection.trim()),
12+
`https://www.amazon.com/s?k=${encodeURIComponent(selection.trim())}`,
1313
"_blank",
1414
)
1515
.focus();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window
22
.open(
3-
"https://archive.today/submit/?url=" + encodeURIComponent(location.href),
3+
`https://archive.today/submit/?url=${encodeURIComponent(location.href)}`,
44
"_blank",
55
)
66
.focus();

javascripts/Bing - Search selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (selection === undefined || selection.length === 0) {
99
} else {
1010
window
1111
.open(
12-
"https://www.bing.com/search?q=" + encodeURIComponent(selection.trim()),
12+
`https://www.bing.com/search?q=${encodeURIComponent(selection.trim())}`,
1313
"_blank",
1414
)
1515
.focus();

javascripts/DOM - NATO spell selection.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ if (selection === undefined || selection.length === 0) {
5757
if (d === undefined) {
5858
t = h[c.toUpperCase()];
5959
if (t === undefined) {
60-
d = "%" + c.codePointAt(0).toString(16).toUpperCase();
60+
d = `%${c.codePointAt(0).toString(16).toUpperCase()}`;
6161
} else {
6262
d = t.toLowerCase();
6363
}
6464
}
65-
result += d + " ";
65+
result += `${d} `;
6666
}
6767
window.alert(result);
6868
}

javascripts/DOM - Show anchors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ for (i = 0; i < anchors.length; i += 1) {
44
anchor = anchors[i];
55
id = anchor.id;
66
if (id !== undefined && id.length > 0) {
7-
anchor.appendChild(document.createTextNode(" #" + id));
7+
anchor.appendChild(document.createTextNode(` #${id}`));
88
}
99
}

javascripts/DOM - Show feeds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ for (i = 0; i < links.length; i += 1) {
99
link.type.indexOf("atom") !== -1 ||
1010
link.type.indexOf("feed") !== -1)
1111
) {
12-
msg += link.href + "\n";
12+
msg += `${link.href}\n`;
1313
}
1414
}
1515
if (msg.length > 0) {

javascripts/DOM - Show password.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if (document.hasFocus()) {
22
if (document.activeElement.value) {
3-
window.alert("Password: " + document.activeElement.value);
3+
window.alert(`Password: ${document.activeElement.value}`);
44
}
55
} else {
66
window.alert("Move cursor to desired password field.");

javascripts/Domaintools - Whois.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
window
22
.open(
3-
"https://whois.domaintools.com/" + encodeURIComponent(location.hostname),
3+
`https://whois.domaintools.com/${encodeURIComponent(location.hostname)}`,
44
"_blank",
55
)
66
.focus();

javascripts/DuckDuckGo - Search selection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (selection === undefined || selection.length === 0) {
99
} else {
1010
window
1111
.open(
12-
"https://duckduckgo.com/?q=" + encodeURIComponent(selection.trim()),
12+
`https://duckduckgo.com/?q=${encodeURIComponent(selection.trim())}`,
1313
"_blank",
1414
)
1515
.focus();

0 commit comments

Comments
 (0)