From f2b7b331412e9f1314a3ff10dd4b9e52337e44c9 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Tue, 3 Dec 2024 12:05:48 +0200 Subject: [PATCH] --- Source/Function/Type.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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;