cron-parser icon indicating copy to clipboard operation
cron-parser copied to clipboard

iterate with for...of

Open chrischjh opened this issue 7 years ago • 3 comments

It seems you didn't implement Symbol.iterator thus can't iterate via for...of:

const interval = CronExpression.parse('0 * * * *', options)
for (let i of interval) {
    console.log(i.value.toString())
}

chrischjh avatar Nov 29 '16 05:11 chrischjh

@chrischjh well yes. I'm planning to rewrite it in ES6 in the near future.

harrisiirak avatar Dec 07 '16 17:12 harrisiirak

I'd be willing to help with that (see #112)

yanickrochon avatar Nov 02 '17 14:11 yanickrochon

#203 is a PR that implements this

andytson avatar Jan 10 '21 15:01 andytson