Skip to content

Commit 55f4aac

Browse files
committed
fix: better type alias in navbar patching
1 parent 7e27619 commit 55f4aac

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

typescript/src/getPatchedNavTree.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig
2828
// transform?: (found: string, content: string, position: number) => [string?, string?]
2929
}
3030
const addChildrenRecursivelySwitchFirstCase = ['function addChildrenRecursively(node)', 'switch (node.kind)']
31+
const typeAliasCaseNeedle = [...addChildrenRecursivelySwitchFirstCase, 'TypeAliasDeclaration */']
3132

3233
const patchLocations: PatchLocation[] = [
3334
{
@@ -44,7 +45,7 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig
4445
break;`,
4546
},
4647
{
47-
searchString: 'case 262 /* SyntaxKind.TypeAliasDeclaration */',
48+
searchString: typeAliasCaseNeedle,
4849
linesOffset: 3,
4950
// https://github.com/microsoft/TypeScript/pull/52558/
5051
addString: /* js */ `
@@ -54,7 +55,7 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig
5455
`,
5556
},
5657
{
57-
searchString: 'case 262 /* SyntaxKind.TypeAliasDeclaration */',
58+
searchString: typeAliasCaseNeedle,
5859
linesOffset: 0,
5960
removeLines: 1,
6061
},

0 commit comments

Comments
 (0)