'AJV Standalone validation code from typescript files

I did some schemas using JSONSchemaType in some .ts file following the documentation. It does work when compiling during initialization, but I would like to generate the standalone validation code to keep unsafe-eval in my Content Security Policies. The ajv-cli needs json files to do so, is there a simple way I could keep my type safeties on my schemas declared in .ts file and still generate the validation code ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source