mirror of
https://github.com/primer/css.git
synced 2024-12-28 00:24:36 +03:00
write variables object to data/deprecations.json
This commit is contained in:
parent
61ca4f89ee
commit
e6c6ae10f3
@ -88,15 +88,20 @@ function getPathName(path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function writeDeprecationData() {
|
function writeDeprecationData() {
|
||||||
const {versionDeprecations, selectorDeprecations} = require('../deprecations')
|
const {versionDeprecations, selectorDeprecations, variableDeprecations} = require('../deprecations')
|
||||||
const data = {
|
const data = {
|
||||||
versions: versionDeprecations,
|
versions: versionDeprecations,
|
||||||
selectors: Array.from(selectorDeprecations.entries()).reduce((obj, [selector, deprecation]) => {
|
selectors: mapToObject(selectorDeprecations),
|
||||||
obj[selector] = deprecation
|
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 obj
|
||||||
}, {})
|
}, {})
|
||||||
}
|
}
|
||||||
return writeFile(join(outDir, 'deprecations.json'), JSON.stringify(data, null, 2))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
|
Loading…
Reference in New Issue
Block a user