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 {
|
interface NbtData {
|
||||||
// If you know the exact shape of the parsed data, define it here
|
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +87,6 @@ function getProfit(price: number, rcCost: number, lbin: number): ProfitItem {
|
||||||
snipePP: 0,
|
snipePP: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Auction house fee logic
|
|
||||||
if (price >= 1_000_000) {
|
if (price >= 1_000_000) {
|
||||||
profitItem.RCProfit = lbin + rcCost - price - (lbin + rcCost) * 0.02;
|
profitItem.RCProfit = lbin + rcCost - price - (lbin + rcCost) * 0.02;
|
||||||
profitItem.RCPP = parseFloat(((profitItem.RCProfit * 100) / lbin).toFixed(1));
|
profitItem.RCPP = parseFloat(((profitItem.RCProfit * 100) / lbin).toFixed(1));
|
||||||
|
@ -126,7 +123,6 @@ function splitNumber(num: number = 1, parts: number = 1): number[] {
|
||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust the below types as needed to match your item structure:
|
|
||||||
interface ItemType {
|
interface ItemType {
|
||||||
itemData: {
|
itemData: {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -160,7 +156,6 @@ function getRawCraft(
|
||||||
): number {
|
): number {
|
||||||
let price = 0;
|
let price = 0;
|
||||||
|
|
||||||
// If you have a more specific type for config, use that
|
|
||||||
const typedConfig = config as ConfigType;
|
const typedConfig = config as ConfigType;
|
||||||
|
|
||||||
const ignoreMatch: string =
|
const ignoreMatch: string =
|
||||||
|
@ -183,7 +178,6 @@ function getRawCraft(
|
||||||
if (isInIgnore) {
|
if (isInIgnore) {
|
||||||
const enchantMinValue =
|
const enchantMinValue =
|
||||||
typedConfig.filters.EnchantThresholdConditionalBypass[ignoreMatch]?.[enchant];
|
typedConfig.filters.EnchantThresholdConditionalBypass[ignoreMatch]?.[enchant];
|
||||||
// If enchantMinValue is defined and the degree is within that threshold, skip.
|
|
||||||
if (enchantMinValue && degree <= enchantMinValue) continue;
|
if (enchantMinValue && degree <= enchantMinValue) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
|
"strict": true,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|
Loading…
Reference in a new issue