static isMaximum()

Checks whether the value of any type is the Maximum instance of any or the given primitive value

Maximum.isMaximum()

Checks whether the value of anyarrow-up-right type is the Maximum instance of any or the given primitive value.

maximum.class.ts
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 anyarrow-up-right type to test against the Maximum instance.

max?:Value

Optional maximum of the generic type variable Value to check if it's the primitive value of the given value.

Return type

value is Maximum<Value>

The return type is a booleanarrow-up-right resulting from its statement indicating the value is the Maximum object that takes the generic type variable Value.

Returns

The return value is a booleanarrow-up-right indicating whether the provided value is an instance of Maximum.

Example usage

Last updated