UNPKG

@neodx/vfs

Version:

Simple virtual file system - working dir context, lazy changes, different modes, integrations and moreover

40 lines (39 loc) 1.08 kB
var r = require('@neodx/glob'), e = require('@neodx/std'), a = require('../_internal/create-vfs-plugin-Bg0LL_-h.cjs'), n = require('./scan.cjs'); async function i( e, { glob: a, ignore: i, timeout: t, signal: s, log: l = e.log.child('glob'), maxDepth: c } ) { let o = n.createScanVfsCache(); return await r.walkGlob(a, { timeout: t, ignore: i, signal: s, log: l, reader: async ({ path: r, isIgnored: a, isMatched: i, signal: t }) => (await e.isFile(r)) ? i(r) ? [''] : [] : await n.scanVfs(e, { path: r, cache: o, signal: t, maxDepth: c, filter: ({ relativePath: r }) => i(r), barrier: ({ relativePath: r }) => a(r) }) }); } (exports.glob = function () { return a.createVfsPlugin('glob', r => { async function a(a, n) { return await i(r, Array.isArray(a) || e.isTypeOfString(a) ? { ...n, glob: a } : a); } return (r.glob = a), r; }); }), (exports.globVfs = i); //# sourceMappingURL=glob.cjs.map