Class: shaka.util.Iterables

Constructor

new Iterables()

Source:

Methods

enumerate(iterablenon-null) → {Iterable.<{i: number, item: T, prev: (T|undefined), next: (T|undefined)}>}

Iterates over an iterable object and includes additional info about each item: - The zero-based index of the element. - The next item in the list, if it exists. - The previous item in the list, if it exists.
Parameters:
Name Type Description
iterable Iterable.<T>
Source:
Returns:
Type
Iterable.<{i: number, item: T, prev: (T|undefined), next: (T|undefined)}>

every(iterablenon-null, test) → {boolean}

Parameters:
Name Type Description
iterable Iterable.<T>
test function(T):boolean
Source:
Returns:
Type
boolean

filter(iterablenon-null, filter) → {Array.<T>}

Iterate over an iterable object and return only the items that |filter| returns true for.
Parameters:
Name Type Description
iterable Iterable.<T>
filter function(T):boolean
Source:
Returns:
Type
Array.<T>

map(iterablenon-null, mapping) → {Iterable.<TO>}

Parameters:
Name Type Description
iterable Iterable.<FROM>
mapping function(FROM):TO
Source:
Returns:
Type
Iterable.<TO>

range(end) → {Iterable.<number>}

Returns an iterable that contains numbers in the range [0, end).
Parameters:
Name Type Description
end number The exclusive end of the list.
Source:
Returns:
Type
Iterable.<number>

some(iterablenon-null, test) → {boolean}

Parameters:
Name Type Description
iterable Iterable.<T>
test function(T):boolean
Source:
Returns:
Type
boolean