Methods

The `Range` object methods

public static create(): Range<Value> Returns a new instance of Range with a range of the given required min, max and optional current value, step.

public static createFrom(): Range<number, number, Step> Creates the Range instance from the given random numbers and the step.

public static createMaximum(): Maximum<Value> Returns the Maximum instance of the given maximum value.

public static createMinimum(): Minimum<Value> Returns the Minimum instance of the given minimum value.

public static isRange(): value is Range<Min, Max> Checks whether the value is an instance of Range of any or the given minimum and maximum range and step.

public forEachStep(): this Performs the specified action for each step in the maximum range of an Array.

public getCurrentRange(): Readonly<Array<number>> | undefined Returns a range of numbers from minimum to the current value by the step of a specified Range object.

public getCurrentStep(): number | undefined Returns the step of the range value.

public getMax(): Max Gets the maximum range of a specified Range object.

public getMin(): Min Gets the minimum range of a specified Range object.

public getRange(): number[] Returns range of numbers from minimum to the given value with the step of a specified Range object.

public getRangeOfStep(): Readonly<Array<number>> | undefined Returns a range of numbers by the specified step from the minimum to the given step of a specified Range object.

public getValueOfStep(): number | undefined Returns the range value of the given step.

public has(): boolean Checks whether the value is in the range of a specified Range object.

public hasEvery(): boolean Checks whether every value of the given values is in the range of a specified Range object.

public hasSome(): boolean Checks whether some values are in the range of a specified Range object.

public isBetween(): boolean Checks whether range of the given min and max is between the range of a specified Range object.

public isBetweenEvery(): boolean Checks whether the range of a specified Range object is between every range of the given ranges.

public isBetweenSome(): boolean Checks whether the range of a specified Range object is between some given ranges.

public maxGreaterThan(): boolean Checks whether the value is less than the maximum range of a specified Range object.

public maxLessThan(): boolean Checks whether the value is greater than the maximum range of a specified Range object.

public minGreaterThan(): boolean Checks whether the value is less than a minimum range of a specified Range object.

public minLessThan(): boolean Checks whether the value is greater than the minimum range of a specified Range object.

public setValue(): this Sets the range value between the minimum and maximum of a specified Range object.

public setValueToStep(): this Sets the value of the specified Range object to the value of the given step.

public stepByStep(): this Performs a callback function with the ability to decide when to move to the next step of the range.

public toArray(): readonly [Min, Max] Returns a read-only array of the range in order minimum and maximum.

public valueOf(): Readonly<{ min: Min; max: Max }> Returns a read-only object consisting of the primitive values of Minimum and Maximum instances.

Last updated