class

Range(fromValue, toValue, step)

An abstract class defining a range of numbers between 2 points inclusively divided by a step value.

Constructor

class

new Range(fromValue, toValue, step)

Create a new instance.
Parameters:
Name Type Default Description
fromValue number The lowest inclusive value in range
toValue number The highest inclusive value in range
step number 1 The internal unit size.
Source:

Members

member

fromValue

Get fromValue.
Source:
member

step

Get step unit.
Source:
member

toValue

Get toValue.
Source:

Methods

function

inRange(value) → {boolean}

Determine if a value is within this range. A TypeError is thrown when value is not a number or bigint. Subclasses should override and call this method for basic type checking.
Parameters:
Name Type Description
value number | bigint The number or bigint to check.
Source:
Returns:
- True if value satisfies the range; false otherwise.
Type boolean
function

isValidType(parameterType) → {boolean}

Abstract method that determines if a ParameterType is compatible. Subclasses must implement this method.
Parameters:
Name Type Description
parameterType ParameterType The parameter type to test.
Source:
Returns:
- True if parameterType is compatible; otherwise return false.
Type boolean