UNPKG

radashi-helper

Version:
35 lines (33 loc) 662 B
// src/util/findSources.ts import glob from "fast-glob"; async function findSources(env, only) { const [src, overrides, rewired] = await Promise.all( [ { id: "src", glob: ["src/**/*.ts", "!src/*.ts"] }, { id: "overrides", glob: ["overrides/src/**/*.ts", "!overrides/src/*.ts"] }, { id: "rewired", glob: ["overrides/rewired/**/*.ts"] } ].map( (file) => only?.includes(file.id) !== false ? glob(file.glob, { cwd: env.root, absolute: true }) : void 0 ) ); return { src, overrides, rewired }; } export { findSources };