Vinyl
    Preparing search index...

    Takes a list of ranges and computes the union ranges on read.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get empty(): boolean

      Returns true if there are zero ranges.

      Returns boolean

    • get ranges(): readonly Range[]

      An accessor to the backed ranges. Implementations must provide an ArrayLike for random-access reading. This will be called at most once per read operation.

      Returns readonly Range[]

    Methods

    • Returns the range at the given value, or null if all ranges are outside the given tolerance. Range values are considered inclusive. That is, a ReadonlyRanges with [0, 1] will return [0, 1] for value 1.

      Parameters

      • value: number

        The value to compare to current ranges.

      • tolerance: number = 0

        The tolerance the value may be outside a range and still considered to be within. Default: 0

      Returns null | Range

    • Returns the range that includes the entire from-to span, within a given tolerance.

      Range values are considered inclusive. That is, a ReadonlyRanges with [0, 2] will return [0, 2] for getRangeContaining(2, 2) or getRangeContaining(0, 0).

      from does not need to be lesser than to.

      Parameters

      • from: number
      • to: number
      • Optionaltolerance: number

      Returns null | Range

    • Returns all ranges where at least part of the range is within the given from-to span.

      from does not need to be lesser than to.

      Parameters

      • from: number
      • to: number
      • tolerance: number = 0

      Returns Range[]

    • Flags the union ranges as invalid. This has no effect if options.useCache is not true.

      Returns void

    • Returns a string representation of an object.

      Returns string