StaticpropCreates a predicate function that checks if a specific property of a record is equal to a given value.
The type of the record (strict overload).
The key of the property to check.
A function that takes a record and returns true if the property is equal to the value.
Creates a predicate function that checks if a specific property of a record is equal to a given value.
The value type of the property (loose overload).
The key of the property to check.
A function that takes a record and returns true if the property is equal to the value.
StaticpropCreates a predicate function that checks if a specific property of a record is not equal to a given value.
The type of the record (strict overload).
The key of the property to check.
A function that takes a record and returns true if the property is not equal to the value.
// Strict object structure
const isNotAdmin = RecordPredicate.propNotEq<User, 'role'>('role', 'admin');
const nonAdmins = users.filter(isNotAdmin);
Creates a predicate function that checks if a specific property of a record is not equal to a given value.
The value type of the property (loose overload).
The key of the property to check.
A function that takes a record and returns true if the property is not equal to the value.
// Strict object structure
const isNotAdmin = RecordPredicate.propNotEq<User, 'role'>('role', 'admin');
const nonAdmins = users.filter(isNotAdmin);
The
RecordPredicateclass provides utility functions for creating predicate functions for record properties.Since
v1.1.0