Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-bcd: fix getSupportMatrix overrides param type #743

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ export type BrowserSupportMap = Map<string, TestResultValue>;
export type SupportMap = Map<BrowserName, BrowserSupportMap>;
export type SupportMatrix = Map<string, SupportMap>;

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

export interface IDLFiles {
Expand Down
Loading