Skip to content

Commit 9e5ece7

Browse files
committed
-
1 parent e93c0e0 commit 9e5ece7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/build/mdn-comments.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ const paths: Record<string, string[]> = {
2020
"webassembly-static-method": ["methods", "method"],
2121
};
2222

23-
function ensureLeaf(obj: Record<string, any>, keys: string[]) {
24-
let leaf = obj;
25-
for (const key of keys) {
26-
leaf[key] ??= {};
27-
leaf = leaf[key];
28-
}
29-
return leaf;
30-
}
31-
3223
function extractSlug(slug: string): string[] {
3324
for (const subdirectory of subdirectories) {
3425
if (!slug.toLowerCase().startsWith(subdirectory)) {
@@ -42,6 +33,17 @@ function extractSlug(slug: string): string[] {
4233
return [];
4334
}
4435

36+
function ensureLeaf(obj: Record<string, any>, keys: string[]) {
37+
let leaf = obj;
38+
for (const key of keys) {
39+
leaf[key] ??= {};
40+
leaf = leaf[key];
41+
}
42+
return leaf;
43+
}
44+
45+
46+
4547
function insertComment(
4648
root: Record<string, any>,
4749
slug: string[],

0 commit comments

Comments
 (0)