Rttc.coerce()

Coerce a value against the given type schema.

If coercion is impossible for the value or its properties (recursive), default to the base value for the type.

Usage

Hover over inputs/exits for more info.

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


// Coerce a value against the given type schema.

Rttc.coerce({

value: '===',

typeSchema: '*',

}).execSync();

Inputs

value required

The value to coerce.

'==='
typeSchema required

The type schema to coerce against.

'*'

Exits

error

An unexpected error occurred.

success

OK.

'==='