diff --git a/Source/Function/Type.ts b/Source/Function/Type.ts index e69de29..3fa333e 100644 --- a/Source/Function/Type.ts +++ b/Source/Function/Type.ts @@ -0,0 +1,27 @@ +import type Interface from "../Interface/Type.js"; +import type Package from "../Type/Package.js"; + +/** + * @module Type + * + */ +export default (async (...[Filter = false]) => { + const Result = new Map(); + + Result.set("*.csproj", "Nuget"); + Result.set("Cargo.toml", "Cargo"); + Result.set("composer.json", "Composer"); + Result.set("Gemfile", "Bundler"); + Result.set("package.json", "NPM"); + Result.set("packages.config", "Nuget"); + Result.set("requirements.txt", "PIP"); + Result.set("wrangler.toml", "Cloudflare"); + + if (Filter) { + Result.forEach((Value, Key) => + Value !== Filter ? Result.delete(Key) : null, + ); + } + + return Result; +}) satisfies Interface as Interface;