How to use jovo-model - 1 common examples

To help you get started, we’ve selected a few jovo-model examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jovotech / jovo-cli / packages / jovo-cli-core / src / Project.ts View on Github external
validateModel(locale: string, validator: tv4.JsonSchema): void {
		let model: JovoModelData;
		try {
			model = this.getModel(locale);
		} catch (error) {
			if (error.code === 'MODULE_NOT_FOUND') {
				throw new Error(`Could not find model file for locale "${locale}"`);
			}
			throw error;
		}

		const valid = tv4.validate(model, validator);

		if (valid === false) {
			throw new ModelValidationError(tv4.error.message, locale, tv4.error.dataPath);
		}
	}

jovo-model

Jovo Model

Apache-2.0
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis

Popular jovo-model functions

Similar packages