UNPKG

json-api-schema

Version:

JSON Api Schema is a JSON dialect that can describe any Web Based API that uses JSON to exchange data.

29 lines (23 loc) 553 B
class IteratorsIterator constructor: (@iterators) -> @index = 0 @length = @iterators.length next: -> ite = @_currentIterator() ite and ite.hasNext() and ite.next() hasNext: -> ite = @_currentIterator() ite and ite.hasNext() rewind: -> @index = 0 @current() current: -> @_currentIterator().current() _currentIterator: -> if @index < @length if @iterators[@index].hasNext() @iterators[@index] else @index++ @_currentIterator() module.exports = IteratorsIterator