Skip to content

Commit e5c705c

Browse files
committed
fixup: rename to capitals
1 parent 426d10b commit e5c705c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/node/routes/login.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RateLimiter as Limiter } from "limiter"
44
import * as path from "path"
55
import { rootPath } from "../constants"
66
import { authenticated, getCookieDomain, redirect, replaceTemplates } from "../http"
7-
import { getPasswordMethod, handlePasswordValidation, humanPath, sanitizeString, escapeHTML } from "../util"
7+
import { getPasswordMethod, handlePasswordValidation, humanPath, sanitizeString, escapeHtml } from "../util"
88

99
export enum Cookie {
1010
Key = "key",
@@ -113,7 +113,7 @@ router.post("/", async (req, res) => {
113113
throw new Error("Incorrect password")
114114
} catch (error) {
115115
const html = await getRoot(req, error)
116-
const escapedHTML = escapeHTML(html)
117-
res.send(escapedHTML)
116+
const escapedHtml = escapeHtml(html)
117+
res.send(escapedHtml)
118118
}
119119
})

src/node/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ export const isFile = async (path: string): Promise<boolean> => {
515515
*
516516
* Source: https://stackoverflow.com/a/6234804/3015595
517517
**/
518-
export function escapeHTML(unsafe: string): string {
518+
export function escapeHtml(unsafe: string): string {
519519
return unsafe
520520
.replace(/&/g, "&amp;")
521521
.replace(/</g, "&lt;")

test/unit/node/util.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ describe("onLine", () => {
435435
})
436436
})
437437

438-
describe("escapeHTML", () => {
438+
describe("escapeHtml", () => {
439439
it("should escape HTML", () => {
440-
expect(util.escapeHTML(`<div class="error">"Hello & world"</div>`)).toBe(
440+
expect(util.escapeHtml(`<div class="error">"Hello & world"</div>`)).toBe(
441441
"&lt;div class=&quot;error&quot;&gt;&quot;Hello &amp; world&quot;&lt;/div&gt;",
442442
)
443443
})

0 commit comments

Comments
 (0)