How to use the extglob.isMatch function in extglob

To help you get started, we’ve selected a few extglob examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github krasimir / now-lambda-runner / index.js View on Github external
const matchBuilder = (dest, build) => {
    if (build.src === 'package.json' && build.config && build.config.distDir) {
      const distPath = path.normalize([build.config.distDir, dest].join('/'))
      const exist = fs.existsSync(distPath)
      if (exist) {
        return exist
      }
    }
    return extglob.isMatch(dest, '?(/)' + build.src)
  }
  const getBuilder = dest => nowConf.builds.find(build => matchBuilder(dest, build));

extglob

Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.

MIT
Latest version published 7 years ago

Package Health Score

71 / 100
Full package analysis