This script extracts the definitions of enums. If the script doesn't find a definition for an enum, it will look for the properties that use this enum, and print the definitions of those properties.
-
Install dependencies via
npm i
-
Store the intermediary JSON-LD in
input.jsonld. -
Run the script via
npm start
Note that you can choose your own input file via the option
-i, --input. -
The script generates 2 files:
enums.jsonldcontains the extracted enums.assertions.jsonldcontains the assertions related to the validation of the enums' definitions.
-
The script prints a human-readable version of
assertions.jsonldto standard out.
You find an example in the folder example.
- The file
input.jsonldcontains the intermediary JSON-LD. - The file
enums.jsonldcontains the enums when running the script oninput.jsonld. - The file
stdout.txtcontains the content the script writes to standard out when running the script oninput.jsonld. - The file
assertions.jsonldcontains the assertions when running the script oninput.jsonld.
Run the JavaScript linter via
npm run lint:jsIf you want to automatically fix the issues where possible, run
npm run lint:js:fixRun the Markdown linter via
npm run lint:markdownIf you want to automatically fix the issues where possible, run
npm run lint:markdown:fix