Rttc.validateStrict()

Validate a value against a type schema.

Usage

Hover over inputs/exits for more info.

var Rttc = require('machinepack-rttc');


// Validate a value against a type schema.

Rttc.validateStrict({

value: '===',

typeSchema: '*',

}).execSync();

Inputs

value required

The actual value to validate.

'==='
typeSchema required

The expected type schema.

'*'

Exits

error

An unexpected error occurred.

invalid

The value is invalid against the provided schema.

[ { code: 'E_INVALID_TYPE',
    keypath: 'foo.bar.0.baz',
    expected: '*',
    actual: '===' } ]
success

OK.