Skip to content

Commit

Permalink
fix(core/updates): error on JSR deps with yanked = false version
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Aug 4, 2024
1 parent d75b7d9 commit fcec4de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ async function getJsrVersions(dep: DependencyState<"jsr">): Promise<string[]> {
assertOk(res);
const isJsrPackageMeta = is.ObjectOf({
versions: is.RecordOf(
is.ObjectOf({ yanked: is.OptionalOf(is.LiteralOf(true)) }),
is.ObjectOf({ yanked: is.OptionalOf(is.Boolean) }),
is.String,
),
});
Expand Down
7 changes: 6 additions & 1 deletion core/updates_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("get", () => {
});
});

it("should get an update to a http dep with a v-lead semver", async () => {
it("should get an update to a http dep with a v-prefixed semver", async () => {
const dep = parse("https://deno.land/x/flash@v0.8.0");
assertEquals(await get(dep), {
released: "v0.8.1",
Expand Down Expand Up @@ -63,6 +63,11 @@ describe("get", () => {
assertEquals(await get(dep), undefined);
});

it("should not throw on a jsr dep with a `yanked = false` version", async () => {
const dep = parse("jsr:@denosaurs/emoji@~0.3.0");
await get(dep);
});

it("should get an update to a npm dep", async () => {
const dep = parse("npm:@conventional-commits/parser@^0.3.0");
assertEquals(await get(dep), {
Expand Down

0 comments on commit fcec4de

Please sign in to comment.