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.

22 lines (17 loc) 333 B
class ArrayIterator constructor: (@data) -> @index = 0 @length = @data.length next: -> return null unless @hasNext() element = @current() @index += 1 element hasNext: -> @index < @length rewind: -> @index = 0 @current() current: -> @data[@index] module.exports = ArrayIterator