diff options
| author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-09-08 14:36:46 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-08 14:36:46 -0400 | 
| commit | 9b86b5a56eba7a2bb08d4dedf1b597110f1f3ecd (patch) | |
| tree | 73c23e9eede5cc0661295e424a67514e4e3a6bf9 | |
| parent | ac12b5093906e3a09724f96fee0c1a5141e52d3b (diff) | |
Update dictionary validation script (#1937)
| -rw-r--r-- | dev/dictionary-validate.js | 28 | 
1 files changed, 17 insertions, 11 deletions
| diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js index 83889fc8..a21fa5cb 100644 --- a/dev/dictionary-validate.js +++ b/dev/dictionary-validate.js @@ -84,16 +84,7 @@ function getSchemas() {  } -async function main() { -    const dictionaryFileNames = process.argv.slice(2); -    if (dictionaryFileNames.length === 0) { -        console.log([ -            'Usage:', -            '  node dictionary-validate <dictionary-file-names>...' -        ].join('\n')); -        return; -    } - +async function testDictionaryFiles(dictionaryFileNames) {      const schemas = getSchemas();      for (const dictionaryFileName of dictionaryFileNames) { @@ -114,10 +105,25 @@ async function main() {  } +async function main() { +    const dictionaryFileNames = process.argv.slice(2); +    if (dictionaryFileNames.length === 0) { +        console.log([ +            'Usage:', +            '  node dictionary-validate <dictionary-file-names>...' +        ].join('\n')); +        return; +    } + +    await testDictionaryFiles(dictionaryFileNames); +} + +  if (require.main === module) { main(); }  module.exports = {      getSchemas, -    validateDictionary +    validateDictionary, +    testDictionaryFiles  }; |