Skip to content

Commit

Permalink
Merge pull request #99 from Microsoft/octref/mdn-status
Browse files Browse the repository at this point in the history
Minify status entry in browser.ts. Fix #94
  • Loading branch information
octref authored May 25, 2018
2 parents 3bd22ec + 2f9a89a commit 09b3b80
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 466 deletions.
19 changes: 18 additions & 1 deletion build/mdn-data-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,29 @@ function buildPropertiesWithMDNData(vscProperties) {
* Extract only the MDN data that we use
*/
function extractMDNProperties(mdnEntry) {
if (mdnEntry.status === 'standard') {
return {
syntax: mdnEntry.syntax
}
}

return {
status: mdnEntry.status,
status: abbreviateStatus(mdnEntry.status),
syntax: mdnEntry.syntax
}
}

/**
* Make syntax as small as possible for browser usage
*/
function abbreviateStatus(status) {
return {
nonstandard: 'n',
experimental: 'e',
obsolete: 'o'
}[status];
}

module.exports = {
buildPropertiesWithMDNData
}
Loading

0 comments on commit 09b3b80

Please sign in to comment.