Skip to content

Commit

Permalink
Omit discontinued specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Jan 10, 2024
1 parent c193b64 commit bc8f231
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scanner/browser-specs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import z from 'zod';

// See https://github.com/w3c/browser-specs/blob/main/schema/index.json for the authoritative schema.
const WebSpecs = z.object({
categories: z.enum(["browser"]).array(),
standing: z.enum(["good", "pending", "discontinued"]),
nightly: z.object({
repository: z.string().url().optional(),
})
Expand All @@ -11,9 +13,10 @@ export type WebSpecs = z.infer<typeof WebSpecs>;
export type BrowserSpecs = WebSpecs;

export async function webSpecs() {
return WebSpecs.parse(
await fetch('https://w3c.github.io/browser-specs/index.json'
).then(response => response.json()));
const allSpecs = WebSpecs.parse(
await fetch('https://w3c.github.io/browser-specs/index.json')
.then(response => response.json()))
return allSpecs.filter(spec => spec.standing !== "discontinued");
}

export async function browserSpecs() {
Expand Down

0 comments on commit bc8f231

Please sign in to comment.