1
1
mirror of https://github.com/primer/css.git synced 2024-12-26 15:43:59 +03:00

write variables object to data/deprecations.json

This commit is contained in:
Shawn Allen 2019-11-01 11:05:46 -07:00
parent 61ca4f89ee
commit e6c6ae10f3

View File

@ -88,15 +88,20 @@ function getPathName(path) {
}
function writeDeprecationData() {
const {versionDeprecations, selectorDeprecations} = require('../deprecations')
const {versionDeprecations, selectorDeprecations, variableDeprecations} = require('../deprecations')
const data = {
versions: versionDeprecations,
selectors: Array.from(selectorDeprecations.entries()).reduce((obj, [selector, deprecation]) => {
obj[selector] = deprecation
selectors: mapToObject(selectorDeprecations),
variables: mapToObject(variableDeprecations)
}
return writeFile(join(outDir, 'deprecations.json'), JSON.stringify(data, null, 2))
function mapToObject(map) {
return Array.from(map.entries()).reduce((obj, [key, value]) => {
obj[key] = value
return obj
}, {})
}
return writeFile(join(outDir, 'deprecations.json'), JSON.stringify(data, null, 2))
}
if (require.main === module) {