From e6c6ae10f3554135d964c9f6125d0d88278208ca Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Fri, 1 Nov 2019 11:05:46 -0700 Subject: [PATCH] write variables object to data/deprecations.json --- script/dist.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/script/dist.js b/script/dist.js index fe89e9f0..d3d5b6d9 100755 --- a/script/dist.js +++ b/script/dist.js @@ -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) {