Skip to content

Commit

Permalink
update-bcd: fix getSupportMatrix overrides param type (#743)
Browse files Browse the repository at this point in the history
* update-bcd: fix getSupportMatrix overrides param type

* fixup! update-bcd: fix getSupportMatrix overrides param type

---------

Co-authored-by: Queen Vinyl Da.i'gyu-Kazotetsu <[email protected]>
  • Loading branch information
mzgoddard and queengooborg committed Nov 5, 2023
1 parent bcc42d9 commit 8d9f1dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions scripts/update-bcd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
BrowserSupportMap,
Overrides,
InternalSupportStatement,
OverrideTuple,
} from "../types/types.js";

import assert from "node:assert";
Expand Down Expand Up @@ -137,7 +138,7 @@ export const getSupportMap = (report: Report): BrowserSupportMap => {
export const getSupportMatrix = (
reports: Report[],
browsers: Browsers,
overrides: Overrides,
overrides: OverrideTuple[],
): SupportMatrix => {
const supportMatrix = new Map();

Expand Down Expand Up @@ -642,7 +643,7 @@ export const main = async (
const supportMatrix = getSupportMatrix(
reports,
browsers,
overrides.filter(Array.isArray),
overrides.filter(Array.isArray as (item: unknown) => item is OverrideTuple),
);

// Should match https://github.com/mdn/browser-compat-data/blob/f10bf2cc7d1b001a390e70b7854cab9435ffb443/test/linter/test-style.js#L63
Expand Down
5 changes: 2 additions & 3 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,8 @@ export type BrowserSupportMap = Map<string, TestResultValue>;
export type SupportMap = Map<BrowserName, BrowserSupportMap>;
export type SupportMatrix = Map<string, SupportMap>;

export type Overrides = Array<
string | Array<string, string, string, TestResultValue>
>;
export type OverrideTuple = [string, string, string, TestResultValue];
export type Overrides = Array<string | OverrideTuple>;

export interface IDLFiles {
[filename: string]: WebIDL2.IDLRootType[];
Expand Down

0 comments on commit 8d9f1dc

Please sign in to comment.