enforcing strict types
This commit is contained in:
parent
d44ad19efc
commit
d4275929ac
2 changed files with 1 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "./dist",
|
||||
"strict": true,
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
|
|
Loading…
Reference in a new issue