githubEdit

static isMinimum()

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

Minimum.isMinimum()

The static isMinimum() method checks the provided value of anyarrow-up-right type whether is an instance of Minimum of any or the given min.

minimum.class.ts
public static isMinimum<Value extends number>(
  value: any,
  min?: Value
): value is Minimum<Value> {
  return (
    typeof value === 'object' &&
    value instanceof this &&
    (typeof min === 'number' ? value.valueOf() : true)
  );
}

Generic type variables

A generic type variable indicates captured type of the supplied min via the return type.

Parameters

The value of anyarrow-up-right type to test against the Minimum instance.

min?:Value

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

Return type

value is Minimum<Value>

The return type is a booleanarrow-up-right resulting from its statement indicating the value is the Minimum 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 Minimum of any or the given min.

Example usage

Last updated