static isMaximum()
Checks whether the value of any type is the Maximum instance of any or the given primitive value
Maximum.isMaximum()
Maximum.isMaximum()Checks whether the value of any type is the Maximum instance of any or the given primitive value.
public static isMaximum<Value extends number>(
value: any,
max?: Value
): value is Maximum<Value> {
return (
typeof value === 'object' &&
value instanceof this &&
(typeof max === 'number' ? value.valueOf() === max : true)
);
}Generic type variables
A generic type variable indicates captured type of the supplied max via the return type.
Parameters
The value of any type to test against the Maximum instance.
Optional maximum of the generic type variable Value to check if it's the primitive value of the given value.
Return type
The return type is a boolean resulting from its statement indicating the value is the Maximum object that takes the generic type variable Value.
Returns
The return value is a boolean indicating whether the provided value is an instance of Maximum.
Example usage
// Example usage.
import { Maximum } from '@angular-package/range';
Last updated
Was this helpful?