Skip to content
Sergej edited this page Apr 30, 2019 · 1 revision

Multiples

const schema = new Schema<Model>()
    .with(m => m.NumberProp, new NumberSchema({
        multipleOf: 10
    }))
    .build();

Range

const schema = new Schema<Model>()
    .with(m => m.NumberProp, x => x >= 10)
    // or
    .with(m => m.NumberProp, new NumberSchema({
        minimum: 10,
        maximum: 15,
    })
    .build();

Supported operators: ==, ===, >=, <=, >, < Does not make use of exclusiveMaximum due to differences in implementations between drafts.

Clone this wiki locally