@jeremyckahn/farmhand
Version:
A farming game
22 lines (18 loc) • 435 B
text/typescript
import { itemType } from '../enums.js'
import { isItemAGrownCrop } from './isItemAGrownCrop.js'
const FARM_PRODUCT_TYPES = [
itemType.CRAFTED_ITEM,
itemType.FUEL,
itemType.MILK,
itemType.ORE,
itemType.STONE,
]
/**
* @param {farmhand.item} item
* @returns {boolean}
*/
export const isItemAFarmProduct = item =>
Boolean(
isItemAGrownCrop(item) ||
FARM_PRODUCT_TYPES.includes(/** @type {any} */ item.type)
)