Bamieh/reflow

View on GitHub
packages/reflow-core/src/utils/glob.ts

Summary

Maintainability
A
0 mins
Test Coverage
import * as glob from 'glob'
import {promisify} from 'util'

export
type Pattern = string

export
type GlobObject = {
  pattern: Pattern,
  globOptions?: any
}

export
const createGlobObject = (glob: Pattern | GlobObject): GlobObject => {
  return typeof glob === "string"? { pattern: glob } : glob;
}

export
const globAsync = promisify(glob);