Skip to content

Commit

Permalink
fixup!: type for extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Dec 12, 2024
1 parent 79028f7 commit 2b186c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions recipes/correct-ts-specifiers/src/exts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const suspectExts = {

export type SuspectExt = keyof typeof suspectExts;
export type JSExt = keyof typeof jsToTSExts;
export const jsExts = Object.keys(jsToTSExts) as Array<JSExt>;
export const tsExts = Object.values(jsToTSExts);
export const jsExts = Object.keys(jsToTSExts) as ReadonlyArray<JSExt>;
export const tsExts = Object.values(jsToTSExts) as ReadonlyArray<typeof jsToTSExts[JSExt]>;
export type TSExt = (typeof tsExts)[number];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function checkSet<Ext extends DExt | JSExt | TSExt>(
parentPath: FSAbsolutePath | ResolvedSpecifier,
specifier: Specifier,
oExt: JSExt,
exts: Array<Ext>,
exts: ReadonlyArray<Ext>,
) {
let replacement: Specifier;

Expand Down

0 comments on commit 2b186c8

Please sign in to comment.