Skip to content

Collection isn't iterable #679

@codingjoe

Description

@codingjoe

Howdy, y'all 👋,

I wanted to use a for .. of-loop on a Collection and noticed that it isn't an iterable.

The fix would be rather simple; the class needs to implement Symbol.iterator, like so:

class Collection {
  *[Symbol.iterator]() {
    yield* this.__paths
  }
}

I am happy to provide a patch with tests 💯

Thanks!
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions