From d4275929ac2849e4128790bd8f1aea42c3842134 Mon Sep 17 00:00:00 2001 From: ulysia Date: Fri, 27 Dec 2024 22:16:26 +0100 Subject: [PATCH] enforcing strict types --- src/helperFunctions.ts | 6 ------ tsconfig.json | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/helperFunctions.ts b/src/helperFunctions.ts index 859c590..0d7e391 100644 --- a/src/helperFunctions.ts +++ b/src/helperFunctions.ts @@ -18,9 +18,7 @@ interface ConfigType { }; } -// Prismarine-nbt parse’s callback has this shape: interface NbtData { - // If you know the exact shape of the parsed data, define it here [key: string]: any; } @@ -89,7 +87,6 @@ function getProfit(price: number, rcCost: number, lbin: number): ProfitItem { snipePP: 0, }; - // Auction house fee logic if (price >= 1_000_000) { profitItem.RCProfit = lbin + rcCost - price - (lbin + rcCost) * 0.02; profitItem.RCPP = parseFloat(((profitItem.RCProfit * 100) / lbin).toFixed(1)); @@ -126,7 +123,6 @@ function splitNumber(num: number = 1, parts: number = 1): number[] { return arr; } -// Adjust the below types as needed to match your item structure: interface ItemType { itemData: { id: string; @@ -160,7 +156,6 @@ function getRawCraft( ): number { let price = 0; - // If you have a more specific type for config, use that const typedConfig = config as ConfigType; const ignoreMatch: string = @@ -183,7 +178,6 @@ function getRawCraft( if (isInIgnore) { const enchantMinValue = typedConfig.filters.EnchantThresholdConditionalBypass[ignoreMatch]?.[enchant]; - // If enchantMinValue is defined and the degree is within that threshold, skip. if (enchantMinValue && degree <= enchantMinValue) continue; } diff --git a/tsconfig.json b/tsconfig.json index 5b3c33d..9eb6412 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ "esModuleInterop": true, "skipLibCheck": true, "outDir": "./dist", + "strict": true, }, "exclude": [ "node_modules",