thecodrr / fdir

⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
https://thecodrr.github.io/fdir/
MIT License
1.51k stars 58 forks source link

Export type `Options` from `crawlWithOptions(dir, Options)` #67

Closed vjpr closed 2 years ago

vjpr commented 3 years ago

I like to use options like:

import {fdir, Options} from 'fdir'

  const opts: Options = {
    includeBasePath: true,
    exclude: p => {
      return p.indexOf('node_modules') > -1
    },
    filters: [p => p.endsWith('package.json')],
  }
  const files = new fdir().crawlWithOptions(dir, opts).sync()
  return files
TS2459: Module '"fdir"' declares 'Options' locally, but it is not exported.

Also, thoughts on runtime validation for this? With zod or something.

thecodrr commented 2 years ago

Fixed in v5.2.0