This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #917
- Loading branch information
Showing
4 changed files
with
9,175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const fs = require('fs'); | ||
const parse = require('csv-parse/lib/sync'); | ||
const tests = require('./tests.json'); | ||
|
||
const rows = parse(fs.readFileSync('./confluence_24ddcd3e1.csv'), { | ||
columns: true | ||
}); | ||
|
||
// https://stackoverflow.com/a/17572910 | ||
function isUpperCase(str) { | ||
return str === str.toUpperCase(); | ||
} | ||
|
||
for (const row of rows) { | ||
const {api, chrome, firefox, safari} = row; | ||
const [iface, member] = api.split('#'); | ||
const confluenceUrl = `https://web-confluence.appspot.com/#!/catalog?q=%22${iface}%23${member}%22`; | ||
let bcdPath = `api.${iface}.${member}`; | ||
let mdnUrl = `https://developer.mozilla.org/en-US/docs/Web/API/${iface}/${member}`; | ||
if (iface === 'Window' && isUpperCase(member[0])) { | ||
bcdPath = `api.${member}`; | ||
mdnUrl = `https://developer.mozilla.org/en-US/docs/Web/API/${member}`; | ||
} | ||
const check = bcdPath in tests ? 'x' : ' '; | ||
console.log(`- [${check}] ${api} ([Confluence](${confluenceUrl}), [MDN](${mdnUrl}))`); | ||
} |
Oops, something went wrong.