Skip to content

Commit

Permalink
Add caret as optional
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Sep 26, 2024
1 parent a268a0a commit 6322383
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
export const jsrLatest = async (
packageName: string,
defaultsTo = "1",
caret?: boolean,
): Promise<string> => {
const versions: { latest: string } = await fetch(
`https://jsr.io/${packageName}/meta.json`,
Expand All @@ -17,5 +18,5 @@ export const jsrLatest = async (
latest: defaultsTo,
};
});
return `jsr:${packageName}@^${versions.latest}`;
return `jsr:${packageName}@${caret ? "ˆ" : ""}${versions.latest}`;
};

0 comments on commit 6322383

Please sign in to comment.