Given a Schema, returns a Type Guard that checks that the given value is an object implementing at least all the entries of the Schema.
The difference between this Type Guard and matchExactSchema is that this Type Guard will allow additional entries that are
not specified in the Schema. This is usually intended behavior because banning unknown keys would mean you have to implement
a Type Guard for every value, if you don't care about them.
Example
import { matchSchema, match } from'type-guard-helpers'
Given a Schema, returns a Type Guard that checks that the given value is an object implementing at least all the entries of the Schema.
The difference between this Type Guard and
matchExactSchema
is that this Type Guard will allow additional entries that are not specified in the Schema. This is usually intended behavior because banning unknown keys would mean you have to implement a Type Guard for every value, if you don't care about them.Example