How to use the tv4.getSchemaMap function in tv4

To help you get started, we’ve selected a few tv4 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 dareid / chakram / lib / chakram.js View on Github external
/**
Exposes tv4's add schema method. Allows the registration of schemas used for schema validation.
@alias module:chakram.addSchema
@example 
chakram.addSchema('http://example.com/schema', { ... });
*/
exports.addSchema = tv4.addSchema;

/**
Exposes tv4's get schemaMap method. Allows to check the mapping schema object.
@alias module:chakram.getSchemaMap
@example 
chakram.getSchemaMap();
*/
exports.getSchemaMap = tv4.getSchemaMap;

/**
Exposes tv4's add format method. Allows add custom format for schema validation.
@alias module:chakram.addSchemaFormat
@example
chakram.addSchemaFormat('decimal-digits', function (data, schema) {
    if (typeof data === 'string' && !/^[0-9]+$/.test(data)) {
        return null;
    }
    return "must be string of decimal digits";
});
*/
exports.addSchemaFormat = tv4.addFormat;

var warnUser = function (message) {
    if (this.currentTest.state !== 'failed') {