Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
9
node_modules/@pkgr/utils/lib/helpers.js
generated
vendored
9
node_modules/@pkgr/utils/lib/helpers.js
generated
vendored
|
|
@ -41,14 +41,17 @@ export const tryExtensions = (filepath, extensions = EXTENSIONS) => {
|
|||
return ext == null ? '' : filepath + ext;
|
||||
};
|
||||
export const tryGlob = (paths, options = {}) => {
|
||||
const { absolute = true, baseDir = CWD } = typeof options === 'string' ? { baseDir: options } : options;
|
||||
const { absolute = true, baseDir = CWD, ignore = ['**/node_modules/**'], } = typeof options === 'string' ? { baseDir: options } : options;
|
||||
return paths.reduce((acc, pkg) => [
|
||||
...acc,
|
||||
...(isGlob(pkg)
|
||||
? tryRequirePkg('tiny-glob/sync')(pkg, {
|
||||
absolute,
|
||||
? tryRequirePkg('fast-glob')
|
||||
.sync(pkg, {
|
||||
cwd: baseDir,
|
||||
ignore,
|
||||
onlyFiles: false,
|
||||
})
|
||||
.map(file => (absolute ? path.resolve(baseDir, file) : file))
|
||||
: [tryFile(path.resolve(baseDir, pkg), true)]),
|
||||
].filter(Boolean), []);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue