diff --git a/util/wrap-data.js b/util/wrap-data.js deleted file mode 100644 index edcc99b..0000000 --- a/util/wrap-data.js +++ /dev/null @@ -1,15 +0,0 @@ -const { join } = require('path') -const { readJson, outputFile } = require('fs-extra') - -console.log(`Reading packed time zone data source...`) -const data = join(__dirname, './data/packed.json') -readJson(data) - .then(content => { - console.log(`Writing full time zone data module...`) - const module = join(__dirname, '../src/lookup/data.js') - return outputFile(module, `export default ${JSON.stringify(content, undefined, 2)}`) - }) - .catch(error => { - console.error(error) - process.exitCode = 1 - }) diff --git a/util/wrap-limited-data.js b/util/wrap-limited-data.js deleted file mode 100644 index e298e55..0000000 --- a/util/wrap-limited-data.js +++ /dev/null @@ -1,47 +0,0 @@ -const { join } = require('path') -const { readJson, outputFile } = require('fs-extra') -const tz = require('../node_modules/moment-timezone/moment-timezone-utils').tz -const groupLeaders = require('./data/group-leaders.json') - -let data, start, end - -function prepare2012 () { - start = 2012 - end = 2022 - return data -} - -function prepare1900 () { - start = 1900 - end = 2050 - return data -} - -function readData () { - console.log(`Reading unpacked time zone data source...`) - const file = join(__dirname, './data/unpacked.json') - data = readJson(file) - return data -} - -function limitData (data) { - return tz.filterLinkPack(data, start, end, groupLeaders) -} - -function writeScript (data) { - console.log(`Writing limited time zone data module...`) - const module = join(__dirname, `../src/lookup/data-${start}-${end}.js`) - return outputFile(module, `export default ${JSON.stringify(data, undefined, 2)}`) -} - -readData() - .then(prepare2012) - .then(limitData) - .then(writeScript) - .then(prepare1900) - .then(limitData) - .then(writeScript) - .catch(error => { - console.error(error) - process.exitCode = 1 - })