yuanchuan / node-watch

A wrapper and enhancements for fs.watch
https://npm.im/node-watch
MIT License
341 stars 44 forks source link

Types: Allow watching multiple files #87

Closed Gnuk closed 5 years ago

Gnuk commented 5 years ago

Hi @yuanchuan I don't know why threre is those errors because I never changed any implementation. I also don't know why the package-lock.json is not tracked.

yuanchuan commented 5 years ago

Hi @Gnuk

The errors are OK, which are caused by timers. node-watch is dependency-free so I removed it.

yuanchuan commented 5 years ago

Hmm.. currently node-watch can handle the following input:

watch([['./a', './b'], './c'])
watch([[['./a', './b'], './c'], './d'])

Does this Type match it too?

Filename = string | string[]
Gnuk commented 5 years ago

Indeed, TS don't allow Type Recursion, I can put string | any[] but it's not optimal :s

Gnuk commented 5 years ago

Hi @yuanchuan , in fact interfaces allow recursion so I pushed my new idea.

yuanchuan commented 5 years ago

Merged, thanks!