Skip to content

Commit aa9c7bc

Browse files
committed
Refactor GetCraftingRecipes import and remove duplicate
Removed the local GetCraftingRecipes function and replaced it with an import from './Parsers/parseCraftingItems' to avoid duplication and centralize recipe parsing logic.
1 parent a6f16cd commit aa9c7bc

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

src/Utility/index.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import type {
3737
} from 'types/displayDataTypes';
3838
import type { fullPlayerDataType, museumCollectionType } from 'types/displayDataTypes';
3939
import { GetCookingData } from './Parsers/parseCookingItems';
40+
import { GetCraftingRecipes } from './Parsers/parseCraftingItems';
4041

4142
//Gets the info from the farm hands as an array of the same type
4243
const GetFarmHands = (locations: gameLocationType[]): playerType[] => {
@@ -229,21 +230,6 @@ const GetShippedItems = (allShipped: itemType) :generalFormatedItemType[] => {
229230
return data;
230231
}
231232

232-
const GetCraftingRecipes = (recipes: itemsType[]): generalFormatedItemType[] => {
233-
let data: generalFormatedItemType[] = []
234-
if(Array.isArray(recipes)) {
235-
CraftingRec.recipes.forEach(item => {
236-
let d = {
237-
name: item,
238-
image: GetImages(item),
239-
times: recipes.find(i => i.key.string === item)?.value.int || 0,
240-
}
241-
data.push(d)
242-
})
243-
}
244-
return data
245-
}
246-
247233
/* Crop Related Achievements */
248234
const GetCropsAchievements = (allShipped: itemsType[]) : cropsShippedType => {
249235
const poly_crops: generalFormatedItemType[] = []

0 commit comments

Comments
 (0)