Home

tailwind-ctp-intellisense @2de4816e3c148389935fe7c9c4c9037af4f866c3 - 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)
  })
}