Skip to content

Commit 27f8b71

Browse files
authored
Remove toLowerCase functions in MDN comments (microsoft#2224)
1 parent 00d9145 commit 27f8b71

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scripts/fetch-mdn.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ const data = await res.json();
1414
// Filter and map the data
1515
const filtered = Object.values(data)
1616
.filter((entry) => {
17-
const path = entry.mdn_url.toLowerCase();
17+
const path = entry.mdn_url;
1818
return (
19-
path.startsWith("/en-us/docs/web/api/") ||
20-
path.startsWith("/en-us/docs/webassembly/reference/javascript_interface/")
19+
path.startsWith("/en-US/docs/Web/API/") ||
20+
path.startsWith("/en-US/docs/WebAssembly/Reference/JavaScript_interface/")
2121
);
2222
})
2323
.map(({ mdn_url, pageType, summary }) => ({

src/build/mdn-comments.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const inputFile = new URL("../../inputfiles/mdn.json", import.meta.url);
44

55
// Valid subdirectories for our use case
66
const subdirectories = [
7-
"web/api/",
8-
"webassembly/reference/javascript_interface/",
7+
"Web/API/",
8+
"WebAssembly/Reference/JavaScript_interface/",
99
];
1010

1111
const paths: Record<string, string[]> = {
@@ -24,7 +24,7 @@ const paths: Record<string, string[]> = {
2424

2525
function extractSlug(mdnUrl: string): string[] {
2626
for (const subdirectory of subdirectories) {
27-
if (!mdnUrl.toLowerCase().startsWith(subdirectory)) {
27+
if (!mdnUrl.startsWith(subdirectory)) {
2828
continue;
2929
}
3030
return mdnUrl

0 commit comments

Comments
 (0)