Skip to content

Commit b76df6e

Browse files
authored
Handle ranges (≤) in versions (#387)
These only appear before 2020 in BCD and are quite rare, so keep things simple by just removing the ranges. This is what MDN does as well.
1 parent e918f2e commit b76df6e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/update-issues.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ const dateFormat = new Intl.DateTimeFormat("en", { dateStyle: "medium" });
7171
function issueBody(id: string, data: (typeof features)[string]) {
7272
const supportLines = [];
7373
for (const [browser, { name, releases }] of Object.entries(browsers)) {
74-
const version = data.status.support[browser];
75-
if (version) {
76-
const date = releases.find((r) => r.version === version)!.date;
74+
const version = data.status.support[browser as keyof typeof browsers];
75+
const v = version?.replace("≤", "");
76+
if (v) {
77+
const date = releases.find((r) => r.version === v)!.date;
7778
const dateString = dateFormat.format(new Date(date));
7879
supportLines.push(`${name} ${version} (${dateString})`);
7980
} else {

0 commit comments

Comments
 (0)