Home Manual Reference Source

Function

Static Public Summary
public

Compile a function that compares two iterables whose yielded elements are compared using the given comparison function.

public

Compile a function that compares two iterators whose yielded elements are compared using the given comparison function.

Static Private Summary
private

_iterator(compare: Function, itA: Iterator, itB: Iterator): number

Compares two iterators using the given comparison function to compare the yielded elements.

Static Public

public iterable(compare: Function): Function source

import iterable from '@total-order/iter/src/iterable.js'

Compile a function that compares two iterables whose yielded elements are compared using the given comparison function.

Params:

NameTypeAttributeDescription
compare Function

Return:

Function

public iterator(compare: Function): Function source

import iterator from '@total-order/iter/src/iterator.js'

Compile a function that compares two iterators whose yielded elements are compared using the given comparison function.

Params:

NameTypeAttributeDescription
compare Function

Return:

Function

Static Private

private _iterator(compare: Function, itA: Iterator, itB: Iterator): number source

import _iterator from '@total-order/iter/src/_iterator.js'

Compares two iterators using the given comparison function to compare the yielded elements. If one of the iterators is a prefix of the other, the one that is a prefix is considered smaller.

Params:

NameTypeAttributeDescription
compare Function
itA Iterator
itB Iterator

Return:

number