Skip to content

Commit

Permalink
Chore: Upgrade min supported typescript version to 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov committed Oct 2, 2022
1 parent 173dc69 commit 76c6ba7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
node-version: 14
- run: npm install
- run: npm install typescript@4.0.2
- run: npm install typescript@4.5.2
- run: npm run tsc

ts-current:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -17,7 +17,7 @@
},
"homepage": "https://github.com/timocov/dts-bundle-generator",
"dependencies": {
"typescript": ">=4.0.2",
"typescript": ">=4.5.2",
"yargs": "^17.6.0"
},
"devDependencies": {
Expand Down
13 changes: 1 addition & 12 deletions src/helpers/typescript.ts
Expand Up @@ -278,24 +278,13 @@ function getExportsForName(

export type ModifiersMap = Record<ts.ModifierSyntaxKind, boolean>;

const modifiersPriority: Record<ts.ModifierSyntaxKind, number> = {
const modifiersPriority: Partial<Record<ts.ModifierSyntaxKind, number>> = {
[ts.SyntaxKind.ExportKeyword]: 4,
[ts.SyntaxKind.DefaultKeyword]: 3,
[ts.SyntaxKind.DeclareKeyword]: 2,

[ts.SyntaxKind.AsyncKeyword]: 1,
[ts.SyntaxKind.ConstKeyword]: 1,

// we don't care about these modifiers as they are used in classes only and cannot be at the root level
[ts.SyntaxKind.AbstractKeyword]: 0,
[ts.SyntaxKind.ReadonlyKeyword]: 0,
[ts.SyntaxKind.StaticKeyword]: 0,
[ts.SyntaxKind.InKeyword]: 0,
[ts.SyntaxKind.OutKeyword]: 0,
[ts.SyntaxKind.OverrideKeyword]: 0,
[ts.SyntaxKind.PrivateKeyword]: 0,
[ts.SyntaxKind.ProtectedKeyword]: 0,
[ts.SyntaxKind.PublicKeyword]: 0,
};

export function modifiersToMap(modifiers: (readonly ts.Modifier[]) | undefined | null): ModifiersMap {
Expand Down

0 comments on commit 76c6ba7

Please sign in to comment.