{"version":3,"sources":["jsdelivr-header.js","/npm/fs-extra-plus@0.6.0/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,aAAc,mBACZ,WAAY,WAAc,0BAClB,oBAAqB,gBAAmB,cAChD,gBAAmB,mBASrB,eAAe,KAAK,EAAS,GAChC,IAAI,EACwB,MAAxB,IACA,EAAwC,iBAAzB,EAAqC,CAAE,IAAK,GAAyB,GAExF,MAAM,QAAe,SAAS,EAAS,GACjC,EAAM,EAAS,EAAK,SAAM,EAIhC,OAHa,EAAO,KAAI,GACb,EAAQ,SAAS,EAAK,GAAQ,IAE7B,KAAK,YACrB,QAEO,eAAe,YAAY,EAAO,GACrC,MAAM,EAAkB,YAAR,GAAuC,MACvD,IAAI,EAAe,GACnB,IAAK,MAAM,KAAQ,QAAQ,GAAQ,CAC/B,MAAM,EAAW,SAAS,EAAS,GACnC,IAAK,EAAS,WAAW,GACrB,MAAM,IAAI,MAAM,yDAAyD,kCAAyC,WAEjG,WAAW,WAEtB,OAAO,GACb,EAAa,KAAK,GAE1B,CACA,OAAO,CACX,CAEA,SAAS,QAAQ,GACb,OAAQ,aAAiB,MAAS,EAAQ,CAAC,EAC/C","file":"/npm/fs-extra-plus@0.6.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/fs-extra-plus@0.6.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import FastGlob from 'fast-glob';\nimport { pathExists, remove } from 'fs-extra';\nimport { join as pathJoin, resolve as pathResolve } from 'path';\nimport { globCompare } from './util.js';\n/**\n * Simplified and sorted glob function (using fast-glob) for one or more pattern from current directory or a optional cwd one.\n *\n * Note 1: The result will be sorted by natural directory/subdir/filename order (as a would a recursive walk)\n * Note 2: When `cwd` in options, it is added to the file path i.e. `pathJoin(cwd, path)`\n *\n * @returns always sorted result return Promise<string[]>\n*/\nexport async function glob(pattern, cwdOrFastGlobOptions) {\n    let opts = undefined;\n    if (cwdOrFastGlobOptions != null) {\n        opts = (typeof cwdOrFastGlobOptions === 'string') ? { cwd: cwdOrFastGlobOptions } : cwdOrFastGlobOptions;\n    }\n    const result = await FastGlob(pattern, opts);\n    const cwd = (opts) ? opts.cwd : undefined;\n    const list = result.map(path => {\n        return (cwd) ? pathJoin(cwd, path) : path;\n    });\n    return list.sort(globCompare);\n}\n/** Remove one or more files. Resolved the number of names removed */\nexport async function saferRemove(names, cwd) {\n    const baseDir = (cwd) ? pathResolve(cwd) : pathResolve('./');\n    let removedNames = [];\n    for (const name of asArray(names)) {\n        const fullPath = pathJoin(baseDir, name);\n        if (!fullPath.startsWith(baseDir)) {\n            throw new Error(`Path to be removed does not look safe (nothing done): ${fullPath}\\n\\tCause: Does not belong to ${baseDir}`);\n        }\n        const exists = await pathExists(fullPath);\n        if (exists) {\n            await remove(fullPath);\n            removedNames.push(name);\n        }\n    }\n    return removedNames;\n}\n//#region    ---------- Utils ---------- \nfunction asArray(names) {\n    return (names instanceof Array) ? names : [names];\n}\n//#endregion ---------- /Utils ----------\n"]}