Home

tailwind-ctp-intellisense @b61d24b52efaeb6eb00803e6242ffee16cfaf1b3 - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tailwind-ctp-intellisense / packages / tailwindcss-class-names / src / glob.js
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
import nodeGlob from 'glob'
import dlv from 'dlv'
import * as path from 'path'

export function glob(pattern, options = {}) {
  return new Promise((resolve, reject) => {
    let g = new nodeGlob.Glob(pattern, options)
    let matches = []
    let max = dlv(options, 'max', Infinity)
    g.on('match', (match) => {
      matches.push(path.resolve(options.cwd || process.cwd(), match))
      if (matches.length === max) {
        g.abort()
        resolve(matches)
      }
    })
    g.on('end', () => {
      resolve(matches)
    })
    g.on('error', reject)
  })
}