Update index.js

This commit is contained in:
Aleksandr Statciuk 2022-07-06 19:56:45 +03:00
parent 185512e2c5
commit 769717c030
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,10 @@ class EPGGrabber {
}
async grab(channel, date, cb = () => {}) {
if (!(channel instanceof Channel)) {
throw new Error('The first argument must be the "Channel" class')
}
await sleep(this.config.delay)
date = typeof date === 'string' ? getUTCDate(date) : date