Skip to content

Commit

Permalink
compat tables to include Node for web APIs
Browse files Browse the repository at this point in the history
Fixes mdn#3410
  • Loading branch information
peterbe committed Apr 1, 2021
1 parent f8d48ce commit f8248cb
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ const NEW_ISSUE_TEMPLATE = `
`;

function gatherPlatformsAndBrowsers(
category: string
category: string,
data: bcd.Identifier
): [string[], bcd.BrowserNames[]] {
let platforms = ["desktop", "mobile"];
if (category === "javascript") {
if (
category === "javascript" ||
(data.__compat && data.__compat.support.nodejs)
) {
platforms.push("server");
} else if (category === "webextensions") {
platforms = ["webextensions-desktop", "webextensions-mobile"];
Expand Down Expand Up @@ -111,7 +115,7 @@ export default function BrowserCompatibilityTable({
const category = breadcrumbs[0];
const name = breadcrumbs[breadcrumbs.length - 1];

const [platforms, browsers] = gatherPlatformsAndBrowsers(category);
const [platforms, browsers] = gatherPlatformsAndBrowsers(category, data);

function getNewIssueURL() {
const url = "https://github.com/mdn/browser-compat-data/issues/new";
Expand Down

0 comments on commit f8248cb

Please sign in to comment.