File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff 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-
3223function 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+
4547function insertComment (
4648 root : Record < string , any > ,
4749 slug : string [ ] ,
You can’t perform that action at this time.
0 commit comments