From c77c60cb6c6eb4b583730d336f142fa07911b3dc Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Tue, 17 Oct 2023 19:49:12 +0200 Subject: [PATCH 01/16] feat(food): new module --- src/definitions/definitions.ts | 2 + src/definitions/food.ts | 38 +++++++++++++++ src/definitions/index.ts | 1 + src/index.ts | 2 + src/modules/food/index.ts | 88 ++++++++++++++++++++++++++++++++++ 5 files changed, 131 insertions(+) create mode 100644 src/definitions/food.ts create mode 100644 src/modules/food/index.ts diff --git a/src/definitions/definitions.ts b/src/definitions/definitions.ts index ca495e3477a..25142a5748e 100644 --- a/src/definitions/definitions.ts +++ b/src/definitions/definitions.ts @@ -6,6 +6,7 @@ import type { CompanyDefinition } from './company'; import type { DatabaseDefinition } from './database'; import type { DateDefinition } from './date'; import type { FinanceDefinition } from './finance'; +import type { FoodDefinition } from './food'; import type { HackerDefinition } from './hacker'; import type { InternetDefinition } from './internet'; import type { LocationDefinition } from './location'; @@ -39,6 +40,7 @@ export type LocaleDefinition = { database?: DatabaseDefinition; date?: DateDefinition; finance?: FinanceDefinition; + food?: FoodDefinition; hacker?: HackerDefinition; internet?: InternetDefinition; location?: LocationDefinition; diff --git a/src/definitions/food.ts b/src/definitions/food.ts new file mode 100644 index 00000000000..0a5dbe3d0bb --- /dev/null +++ b/src/definitions/food.ts @@ -0,0 +1,38 @@ +import type { LocaleEntry } from './definitions'; + +export type FoodDefinition = LocaleEntry<{ + /** + * List of description patterns. + */ + description_pattern: string[]; + + /** + * Common dish names. + */ + dish: string[]; + + /** + * A list of cooking styles that are commonly associated with a particular food item or recipe. + */ + ethnic_category: string[]; + + /** + * A list of common fruit names. + */ + fruit: string[]; + + /** + * Common ingredient names. + */ + ingredient: string[]; + + /** + * A list of common spice names. + */ + spice: string[]; + + /** + * A list of common vegetable names. + */ + vegetable: string[]; +}>; diff --git a/src/definitions/index.ts b/src/definitions/index.ts index f101f4ff8bb..cb2401156ac 100644 --- a/src/definitions/index.ts +++ b/src/definitions/index.ts @@ -10,6 +10,7 @@ export type { DatabaseDefinition } from './database'; export type { DateDefinition, DateEntryDefinition } from './date'; export type { LocaleDefinition, LocaleEntry } from './definitions'; export type { FinanceDefinition } from './finance'; +export type { FoodDefinition } from './food'; export type { HackerDefinition } from './hacker'; export type { InternetDefinition } from './internet'; export type { LocationDefinition } from './location'; diff --git a/src/index.ts b/src/index.ts index 8adcd3843c7..4901497f8f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,6 +27,7 @@ export type { FinanceDefinition, /** @deprecated Use FinanceDefinition instead */ FinanceDefinition as FinanceDefinitions, + FoodDefinition, HackerDefinition, /** @deprecated Use HackerDefinition instead */ HackerDefinition as HackerDefinitions, @@ -100,6 +101,7 @@ export type { DatabaseModule } from './modules/database'; export type { DatatypeModule } from './modules/datatype'; export type { DateModule, SimpleDateModule } from './modules/date'; export type { Currency, FinanceModule } from './modules/finance'; +export type { FoodModule } from './modules/food'; export type { GitModule } from './modules/git'; export type { HackerModule } from './modules/hacker'; export type { HelpersModule, SimpleHelpersModule } from './modules/helpers'; diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts new file mode 100644 index 00000000000..b9fa6c2b607 --- /dev/null +++ b/src/modules/food/index.ts @@ -0,0 +1,88 @@ +import type { Faker } from '../../faker'; +import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; + +export class FoodModule { + constructor(private readonly faker: Faker) { + bindThisToMemberFunctions(this); + } + + /** + * @example + * faker.food.description() // 'Lasagne' + * + * @since v8.3.0 + */ + description(): string { + return this.faker.helpers.fake( + this.faker.definitions.food.description_pattern + ); + } + + /** + * Generates a random dish name. + * + * @example + * faker.food.dish() // 'Lasagne' + * + * @since v8.3.0 + */ + dish(): string { + return this.faker.helpers.arrayElement(this.faker.definitions.food.dish); + } + + /** + * @example + * faker.food.ethnicCategory() // 'Lasagne' + * + * @since v8.3.0 + */ + ethnicCategory(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.food.ethnic_category + ); + } + + /** + * @example + * faker.food.fruit() // 'Lemon' + * + * @since v8.3.0 + */ + fruit(): string { + return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit); + } + + /** + * @example + * faker.food.ingredient() // 'Butter' + * + * @since v8.3.0 + */ + ingredient(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.food.ingredient + ); + } + + /** + * @example + * faker.food.spice() // 'Chilli' + * + * @since v8.3.0 + */ + spice(): string { + return this.faker.helpers.arrayElement(this.faker.definitions.food.spice); + } + + /** + * @example + * faker.food.vegetable() // 'Broccoli' + * + * @since v8.3.0 + */ + vegetable(): string { + return this.faker.helpers.arrayElement( + this.faker.definitions.food.vegetable + ); + } +} From 697c9eda3a19e14afbbce03f01d76b37bb715da5 Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Tue, 17 Oct 2023 21:19:11 +0200 Subject: [PATCH 02/16] feat(locale): add food data for en --- scripts/generateLocales.ts | 1 + src/faker.ts | 2 + src/locales/en/food/description_pattern.ts | 9 + src/locales/en/food/dish.ts | 56 +++ src/locales/en/food/ethnic_category.ts | 120 +++++ src/locales/en/food/fruit.ts | 71 +++ src/locales/en/food/index.ts | 24 + src/locales/en/food/ingredient.ts | 490 +++++++++++++++++++++ src/locales/en/food/spice.ts | 132 ++++++ src/locales/en/food/vegetable.ts | 66 +++ src/locales/en/index.ts | 2 + 11 files changed, 973 insertions(+) create mode 100644 src/locales/en/food/description_pattern.ts create mode 100644 src/locales/en/food/dish.ts create mode 100644 src/locales/en/food/ethnic_category.ts create mode 100644 src/locales/en/food/fruit.ts create mode 100644 src/locales/en/food/index.ts create mode 100644 src/locales/en/food/ingredient.ts create mode 100644 src/locales/en/food/spice.ts create mode 100644 src/locales/en/food/vegetable.ts diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index 86704a7c03d..496a202887a 100644 --- a/scripts/generateLocales.ts +++ b/scripts/generateLocales.ts @@ -63,6 +63,7 @@ const definitionsTypes: DefinitionType = { database: 'DatabaseDefinition', date: 'DateDefinition', finance: 'FinanceDefinition', + food: 'FoodDefinition', hacker: 'HackerDefinition', internet: 'InternetDefinition', location: 'LocationDefinition', diff --git a/src/faker.ts b/src/faker.ts index e6b5889af36..24764abed43 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -11,6 +11,7 @@ import { CompanyModule } from './modules/company'; import { DatabaseModule } from './modules/database'; import { DateModule } from './modules/date'; import { FinanceModule } from './modules/finance'; +import { FoodModule } from './modules/food'; import { GitModule } from './modules/git'; import { HackerModule } from './modules/hacker'; import { HelpersModule } from './modules/helpers'; @@ -75,6 +76,7 @@ export class Faker extends SimpleFaker { readonly database: DatabaseModule = new DatabaseModule(this); readonly date: DateModule = new DateModule(this); readonly finance = new FinanceModule(this); + readonly food = new FoodModule(this); readonly git: GitModule = new GitModule(this); readonly hacker: HackerModule = new HackerModule(this); readonly helpers: HelpersModule = new HelpersModule(this); diff --git a/src/locales/en/food/description_pattern.ts b/src/locales/en/food/description_pattern.ts new file mode 100644 index 00000000000..88569f35a93 --- /dev/null +++ b/src/locales/en/food/description_pattern.ts @@ -0,0 +1,9 @@ +export default [ + 'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.', + 'One {{food.ingredient}} with a pinch of {{spice}}, topped by a caramelized {{food.fruit}} with whipped cream', + 'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.', + 'One slice of exotic {{animal.crocodilia}} meat, {{food.spice}} {{foo.spice}} butter, with an additional side.', + '28-day aged 300g {{animal.cow}} steak, with choice of two sides.', + 'A slow-roasted {{animal.bird}} with a crisp, golden exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.', + 'A simple {{food.fruit}} pie. No fancy stuff, just pie.', +]; diff --git a/src/locales/en/food/dish.ts b/src/locales/en/food/dish.ts new file mode 100644 index 00000000000..cbf716f8313 --- /dev/null +++ b/src/locales/en/food/dish.ts @@ -0,0 +1,56 @@ +export default [ + 'Arepas', + 'Barbecue Ribs', + 'Bruschette with Tomato', + 'Bunny Chow', + 'Caesar Salad', + 'California Maki', + 'Caprese Salad', + 'Cauliflower Penne', + 'Cheeseburger', + 'Chicken Fajitas', + 'Chicken Milanese', + 'Chicken Parm', + 'Chicken Wings', + 'Chilli con Carne', + 'Ebiten maki', + 'Fettuccine Alfredo', + 'Fish and Chips', + 'French Fries with Sausages', + 'French Toast', + 'Hummus', + 'Katsu Curry', + 'Kebab', + 'Lasagne', + 'Linguine with Clams', + 'Massaman Curry', + 'Meatballs with Sauce', + 'Mushroom Risotto', + 'Pappardelle alla Bolognese', + 'Pasta Carbonara', + 'Pasta and Beans', + 'Pasta with Tomato and Basil', + 'Peking Duck', + 'Philadelphia Maki', + 'Pho', + 'Pierogi', + 'Pizza', + 'Poke', + 'Pork Belly Buns', + 'Pork Sausage Roll', + 'Poutine', + 'Ricotta Stuffed Ravioli', + 'Risotto with Seafood', + 'Salmon Nigiri', + 'Scotch Eggs', + 'Seafood Paella', + 'Som Tam', + 'Souvlaki', + 'Stinky Tofu', + 'Sushi', + 'Tacos', + 'Teriyaki Chicken Donburi', + 'Tiramisù', + 'Tuna Sashimi', + 'Vegetable Soup', +]; diff --git a/src/locales/en/food/ethnic_category.ts b/src/locales/en/food/ethnic_category.ts new file mode 100644 index 00000000000..0413a433a72 --- /dev/null +++ b/src/locales/en/food/ethnic_category.ts @@ -0,0 +1,120 @@ +export default [ + 'Ainu', + 'Albanian', + 'Argentine', + 'Andhra', + 'American', + 'Anglo-Indian', + 'Arab', + 'Armenian', + 'Assyrian', + 'Awadhi', + 'Azerbaijani', + 'Balochi', + 'Bashkir', + 'Belarusian', + 'Bangladeshi', + 'Bengali', + 'Berber', + 'Brazilian', + 'British', + 'Buddhist', + 'Bulgarian', + 'Cajun', + 'Cantonese', + 'Caribbean', + 'Chechen', + 'Chinese cuisine', + 'Chinese Islamic', + 'Circassian', + 'Crimean Tatar', + 'Cypriot', + 'Czech', + 'Danish', + 'Egyptian', + 'English', + 'Ethiopian', + 'Eritrean', + 'Estonian', + 'French', + 'Filipino', + 'Georgian', + 'German', + 'Goan', + 'Goan Catholic', + 'Greek', + 'Gujarati', + 'Hyderabad', + 'Indian cuisine', + 'Indian Chinese', + 'Indian Singaporean cuisine', + 'Indonesian', + 'Inuit', + 'Irish', + 'Italian-American', + 'Italian cuisine', + 'Jamaican', + 'Japanese', + 'Jewish - Israeli', + 'Karnataka', + 'Kazakh', + 'Keralite', + 'Korean', + 'Kurdish', + 'Laotian', + 'Lebanese', + 'Latvian', + 'Lithuanian', + 'Louisiana Creole', + 'Maharashtrian', + 'Mangalorean', + 'Malay', + 'Malaysian Chinese cuisine', + 'Malaysian Indian cuisine', + 'Mediterranean cuisine', + 'Mennonite', + 'Mexican', + 'Mordovian', + 'Mughal', + 'Native American', + 'Nepalese', + 'New Mexican', + 'Odia', + 'Parsi', + 'Pashtun', + 'Polish', + 'Pennsylvania Dutch', + 'Pakistani', + 'Peranakan', + 'Persian', + 'Peruvian', + 'Portuguese', + 'Punjabi', + 'Québécois', + 'Rajasthani', + 'Romani', + 'Romanian', + 'Russian', + 'Sami', + 'Serbian', + 'Sindhi', + 'Slovak', + 'Slovenian', + 'Somali', + 'South Indian', + 'Soviet', + 'Spanish', + 'Sri Lankan', + 'Taiwanese', + 'Tatar', + 'Texan', + 'Thai', + 'Turkish', + 'Tamil', + 'Udupi', + 'Ukrainian', + 'Vietnamese', + 'Yamal', + 'Zambian', + 'Zanzibari', +]; diff --git a/src/locales/en/food/fruit.ts b/src/locales/en/food/fruit.ts new file mode 100644 index 00000000000..1b45db16b5d --- /dev/null +++ b/src/locales/en/food/fruit.ts @@ -0,0 +1,71 @@ +export default [ + 'Apples', + 'Apricots', + 'Aubergine', + 'Avocado', + 'Banana', + 'Berries', + 'Blackberries', + 'Blood oranges', + 'Blueberries', + 'Bush Tomato', + 'Butternut pumpkin', + 'Cantaloupe', + 'Cavalo', + 'Starfruit', + 'Cherries', + 'Corella Pear', + 'Cranberry', + 'Cumquat', + 'Currants', + 'Custard Apples', + 'Custard Apples Daikon', + 'Dates', + 'Dragonfruit', + 'Dried Apricots', + 'Elderberry', + 'Feijoa', + 'Grapefruit', + 'Grapes', + 'Figs', + 'Fingerlime', + 'Goji Berry', + 'Guava', + 'Honeydew melon', + 'Incaberries', + 'Jarrahdale pumpkin', + 'Juniper Berries', + 'Kiwi Fruit', + 'Kiwiberries', + 'Lemon', + 'Limes', + 'Longan', + 'Loquats', + 'Lychees', + 'Mango', + 'Mangosteens', + 'Melon', + 'Mandarins', + 'Mulberries', + 'Nashi Pear', + 'Nectarines', + 'Olives', + 'Oranges', + 'Papaw', + 'Papaya', + 'Passionfruit', + 'Peaches', + 'Pears', + 'Pineapple', + 'Pomegranate', + 'Plums', + 'Prunes', + 'Rockmelon', + 'Snowpeas', + 'Sprouts', + 'Strawberries', + 'Sultanas', + 'Tangelo', + 'Tomatoes', + 'Watermelon', +]; diff --git a/src/locales/en/food/index.ts b/src/locales/en/food/index.ts new file mode 100644 index 00000000000..a3668e5740b --- /dev/null +++ b/src/locales/en/food/index.ts @@ -0,0 +1,24 @@ +/* + * This file is automatically generated. + * Run 'pnpm run generate:locales' to update. + */ +import type { FoodDefinition } from '../../..'; +import description_pattern from './description_pattern'; +import dish from './dish'; +import ethnic_category from './ethnic_category'; +import fruit from './fruit'; +import ingredient from './ingredient'; +import spice from './spice'; +import vegetable from './vegetable'; + +const food: FoodDefinition = { + description_pattern, + dish, + ethnic_category, + fruit, + ingredient, + spice, + vegetable, +}; + +export default food; diff --git a/src/locales/en/food/ingredient.ts b/src/locales/en/food/ingredient.ts new file mode 100644 index 00000000000..e7045ebff50 --- /dev/null +++ b/src/locales/en/food/ingredient.ts @@ -0,0 +1,490 @@ +export default [ + 'Achacha', + 'Adzuki Beans', + 'Agar', + 'Agave Syrup', + 'Ajowan Seed', + 'Albacore Tuna', + 'Alfalfa', + 'Allspice', + 'Almond Oil', + 'Almonds', + 'Amaranth', + 'Amchur', + 'Anchovies', + 'Anchovies', + 'Aniseed', + 'Annatto Seed', + 'Apple Cider Vinegar', + 'Apple Juice', + 'Apple Juice Concentrate', + 'Apples', + 'Bonza', + 'Apples', + 'Apricots', + 'Arborio Rice', + 'Arrowroot', + 'Artichoke', + 'Arugula', + 'Asafoetida', + 'Asian Greens', + 'Asian Noodles', + 'Asparagus', + 'Aubergine', + 'Avocado', + 'Avocado Oil', + 'Avocado Spread', + 'Bacon', + 'Baking Powder', + 'Baking Soda', + 'Balsamic Vinegar', + 'Bamboo Shoots', + 'Banana', + 'Barberry', + 'Barley', + 'Barramundi', + 'Basil Basmati Rice', + 'Bay Leaves', + 'Bean Shoots', + 'Bean Sprouts', + 'Beans', + 'Green Beans', + 'Beef', + 'Beetroot', + 'Berries', + 'Black Eyed Beans', + 'Blackberries', + 'Blood Oranges', + 'Blue Cheese', + 'Blue Eye Trevalla', + 'Blue Swimmer Crab', + 'Blueberries', + 'Bocconcini', + 'Bok Choy', + 'Bonito Flakes', + 'Borlotti Beans', + 'Brazil Nut', + 'Bran', + 'Bread', + 'Rye Bread', + 'Sour Dough Bread', + 'Spelt Bread', + 'White Bread', + 'Wholegrain Bread', + 'Wholemeal', + 'Brie', + 'Broccoli', + 'Broccolini', + 'Brown Rice', + 'Brown Rice Vinegar', + 'Brussels Sprouts', + 'Buckwheat', + 'Buckwheat Noodles', + 'Bulghur', + 'Bush Tomato', + 'Butter', + 'Butter Beans', + 'Buttermilk', + 'Butternut Lettuce', + 'Butternut Pumpkin', + 'Cabbage', + 'Cacao', + 'Cake', + 'Calamari', + 'Camellia Tea Oil', + 'Camembert', + 'Camomile', + 'Candle Nut', + 'Cannellini Beans', + 'Canola Oil', + 'Cantaloupe', + 'Capers', + 'Capsicum', + 'Starfruit', + 'Caraway Seed', + 'Cardamom', + 'Carob Carrot', + 'Carrot', + 'Cashews', + 'Cassia bark', + 'Cauliflower', + 'Cavalo', + 'Cayenne', + 'Celery', + 'Celery Seed', + 'Cheddar', + 'Cherries', + 'Chestnut', + 'Chia Seeds', + 'Chicken', + 'Chickory', + 'Chickpea', + 'Chilli Pepper', + 'Fresh Chillies', + 'Dried Chinese Broccoli', + 'Chinese Cabbage', + 'Chinese Five Spice', + 'Chives', + 'Dark Chocolate', + 'Milk Chocolate', + 'Choy Sum', + 'Cinnamon', + 'Clams', + 'Cloves', + 'Cocoa Powder', + 'Coconut', + 'Coconut Oil', + 'Coconut Water', + 'Coffee', + 'Corella Pear', + 'Coriander Leaves', + 'Coriander Seed', + 'Corn Oil', + 'Corn Syrup', + 'Corn Tortilla', + 'Cornichons', + 'Cornmeal', + 'Cos Lettuce', + 'Cottage Cheese', + 'Cous Cous', + 'Crabs', + 'Cranberry', + 'Cream', + 'Cream Cheese', + 'Cucumber', + 'Cumin', + 'Cumquat', + 'Currants', + 'Curry Leaves', + 'Curry Powder', + 'Custard Apples', + 'Dandelion', + 'Dashi', + 'Dates', + 'Dill', + 'Dragonfruit', + 'Dried Apricots', + 'Duck', + 'Edam', + 'Edamame', + 'Eggplant', + 'Eggs', + 'Elderberry', + 'Endive', + 'English Spinach', + 'Extra Virgin Olive Oil', + 'Farmed Prawns', + 'Feijoa', + 'Fennel', + 'Fennel Seeds', + 'Fenugreek', + 'Feta', + 'Figs', + 'File Powder', + 'Fingerlime', + 'Fish Sauce', + 'Flathead', + 'Flaxseed', + 'Flaxseed Oil', + 'Flounder', + 'Flour', + 'Besan', + 'Buckwheat Flour', + 'Oat Flour', + 'Potato Flour', + 'Rice Flour', + 'Brown Flour', + 'White Flour', + 'Soy Flour', + 'Tapioca Flour', + 'Unbleached Flour', + 'Wholewheat Flour', + 'Freekeh', + 'French Eschallots', + 'Fromage Blanc', + 'Fruit', + 'Galangal', + 'Garam Masala', + 'Garlic', + 'Chives', + 'Goat Cheese', + 'Goat Milk', + 'Goji Berry', + 'Grape Seed Oil', + 'Grapefruit', + 'Grapes', + 'Green Pepper', + 'Green Tea', + 'Green Tea Noodles', + 'Greenwheat Freekeh', + 'Gruyere', + 'Guava', + 'Gula Melaka', + 'Haloumi', + 'Ham', + 'Haricot Beans', + 'Harissa', + 'Hazelnut', + 'Hijiki', + 'Hiramasa Kingfish', + 'Hokkien Noodles', + 'Honey', + 'Honeydew Melon', + 'Horseradish', + 'Hot Smoked Salmon', + 'Hummus', + 'Iceberg Lettuce', + 'Incaberries', + 'Jarrahdale Pumpkin', + 'Jasmine Rice', + 'Jelly', + 'Jerusalem Artichoke', + 'Jewfish', + 'Jicama', + 'Juniper Berries', + 'Lime Leaves', + 'Kale', + 'Kangaroo', + 'Kecap Manis', + 'Kenchur', + 'Kidney Beans', + 'Kidneys', + 'Kiwi Fruit', + 'Kiwi Berries', + 'Kohlrabi', + 'Kokam', + 'Kombu', + 'Koshihikari Rice', + 'Kudzu', + 'Kumera', + 'Lamb', + 'Lavender Flowers', + 'Leeks', + 'Lemon', + 'Lemongrass', + 'Lentils', + 'Lettuce', + 'Licorice', + 'Limes', + 'Liver', + 'Lobster', + 'Longan', + 'Loquats', + 'Lotus Root', + 'Lychees', + 'Macadamia Nut', + 'Macadamia Oil', + 'Mace', + 'Mackerel', + 'Tinned', + 'Mahi Mahi', + 'Mahlab', + 'Malt Vinegar', + 'Mandarins', + 'Mango', + 'Mangosteens', + 'Maple Syrup', + 'Margarine', + 'Marigold', + 'Marjoram', + 'Mastic', + 'Melon', + 'Milk', + 'Mint', + 'Miso', + 'Molasses', + 'Monkfish', + 'Morwong', + 'Mountain Bread', + 'Mozzarella', + 'Muesli', + 'Mulberries', + 'Mullet', + 'Mung Beans', + 'Flat Mushrooms', + 'Brown Mushrooms', + 'Common Cultivated Mushrooms', + 'Enoki Mushrooms', + 'Oyster Mushrooms', + 'Shiitake Mushrooms', + 'Mussels', + 'Mustard', + 'Mustard Seed', + 'Nashi Pear', + 'Nasturtium', + 'Nectarines', + 'Nori', + 'Nutmeg', + 'Nutritional Yeast', + 'Nuts', + 'Oatmeal', + 'Oats', + 'Octopus', + 'Okra', + 'Olive Oil', + 'Olives', + 'Omega Spread', + 'Onion', + 'Oranges', + 'Oregano', + 'Oyster Sauce', + 'Oysters', + 'Pear', + 'Pandanus Leaves', + 'Papaw', + 'Papaya', + 'Paprik', + 'Parmesan Cheese', + 'Parrotfish', + 'Parsley', + 'Parsnip', + 'Passionfruit', + 'Pasta', + 'Peaches', + 'Peanuts', + 'Pear Juice', + 'Pears', + 'Peas', + 'Pecan Nut', + 'Pecorino', + 'Pepitas', + 'Szechuan Pepperberry', + 'Peppercorns', + 'Peppermint', + 'Peppers', + 'Persimmon', + 'Pine Nut', + 'Pineapple', + 'Pinto Beans', + 'Pistachio Nut', + 'Plums', + 'Polenta', + 'Pomegranate', + 'Poppy Seed', + 'Porcini Mushrooms', + 'Pork', + 'Potatoes', + 'Provolone', + 'Prunes', + 'Pumpkin', + 'Pumpkin Seed', + 'Purple Carrot', + 'Purple Rice', + 'Quark Quinc', + 'Quinoa', + 'Radicchio', + 'Radish', + 'Raisin', + 'Raspberry', + 'Red Cabbage', + 'Red Lentils', + 'Red Pepper', + 'Red Wine Vinegar', + 'Redfish', + 'Rhubarb', + 'Rice Noodles', + 'Rice Paper', + 'Rice Syrup', + 'Ricemilk', + 'Ricotta', + 'Rockmelon', + 'Rose Water', + 'Rosemary', + 'Rye', + 'Safflower Oil', + 'Saffron', + 'Sage', + 'Sake', + 'Salmon', + 'Sardines', + 'Sausages', + 'Scallops', + 'Sea Salt', + 'Semolina', + 'Sesame Oil', + 'Sesame Seeds', + 'Shark', + 'Silverbeet', + 'Slivered Almonds', + 'Smoked Trout', + 'Snapper', + 'Snowpea sprouts', + 'Snowpeas', + 'Soba', + 'Soy Beans', + 'Soy Milk', + 'Soy Sauce', + 'Soy', + 'Sprouts', + 'Soymilk', + 'Spearmint', + 'Spelt', + 'Spinach', + 'Spring Onions', + 'Squash', + 'Squid', + 'Star Anise', + 'Star Fruit', + 'Stevia', + 'Beef Stock', + 'Chicken Stock', + 'Fish Stock', + 'Vegetable Stock', + 'Strawberries', + 'Sugar', + 'Sultanas', + 'Sun-Dried Tomatoes', + 'Sunflower Oil', + 'Sunflower Seeds', + 'Sweet Chilli Sauce', + 'Sweet Potato', + 'Swiss Chard', + 'Swordfish', + 'Tabasco', + 'Tahini', + 'Taleggio Cheese', + 'Tamari', + 'Tamarillo', + 'Tangelo', + 'Tapioca', + 'Tarragon', + 'Tea', + 'Tea Oil', + 'Tempeh', + 'Thyme', + 'Tofu', + 'Tom Yum', + 'Tomatoes', + 'Trout', + 'Tuna', + 'Turkey', + 'Turmeric', + 'Turnips', + 'Vanilla Beans', + 'Vegetable Oil', + 'Vegetable Spaghetti', + 'Vermicelli Noodles', + 'Vinegar', + 'Wakame', + 'Walnut', + 'Warehou', + 'Wasabi', + 'Water', + 'Watercress', + 'Watermelon', + 'Wattleseed', + 'Wheat', + 'Wheatgrass Juice', + 'White rice', + 'White Wine Vinegar', + 'Whiting Wild Rice', + 'William Pear', + 'Red Wine', + 'White Wine', + 'Yeast', + 'Yellow Papaw', + 'Yellowtail Kingfish', + 'Yoghurt', + 'Yogurt', + 'Zucchini', +]; diff --git a/src/locales/en/food/spice.ts b/src/locales/en/food/spice.ts new file mode 100644 index 00000000000..0a0211e4b74 --- /dev/null +++ b/src/locales/en/food/spice.ts @@ -0,0 +1,132 @@ +export default [ + 'Achiote Seed', + 'Ajwain Seed', + 'Ajwan Seed', + 'Allspice', + 'Amchoor', + 'Anise', + 'Anise Star', + 'Aniseed', + 'Annatto Seed', + 'Arrowroot', + 'Asafoetida', + 'Baharat', + 'Balti Masala', + 'Balti Stir Fry Mix', + 'Basil', + 'Bay Leaves', + 'BBQ Seasoning', + 'Biryani Spice Mix', + 'Cajun Seasoning', + 'Caraway Seed', + 'Cardamom', + 'Cassia', + 'Cayenne Pepper', + 'Celery', + 'Chamomile', + 'Chervil', + 'Chicken Seasoning', + 'Chilli', + 'Chilli Pepper', + 'Chillies', + 'China Star', + 'Chinese 5 Spice', + 'Chives', + 'Cinnamon', + 'Cloves', + 'Colombo', + 'Coriander', + 'Creole Seasoning', + 'Cumin', + 'Curly Leaf Parsley', + 'Curry', + 'Dhansak Spice Mix', + 'Dill', + 'Fajita Seasoning', + 'Fennel Seed', + 'Fenugreek', + 'Fines Herbes', + 'Fish Seasoning', + 'Five Spice Mix', + 'French Lavender', + 'Galangal', + 'Garam Masala', + 'Garlic', + 'German Chamomile', + 'Ginger', + 'Green Cardamom', + 'Herbes de Provence', + 'Jalfrezi Curry', + 'Jalfrezi Mix', + 'Jerk Seasoning', + 'Juniper Berries', + 'Kaffir Leaves', + 'Korma Curry', + 'Korma Mix', + 'Lamb Seasoning', + 'Lavender', + 'Lemon Grass', + 'Lemon Pepper', + 'Lime Leaves', + 'Liquorice Root', + 'Mace', + 'Mango', + 'Marjoram', + 'Methi', + 'Methi Leaves', + 'Mexican Salsa Mix', + 'Mint', + 'Mixed Herbs', + 'Mixed Spice', + 'Mulled Cider Spices', + 'Mulled Wine Spices', + 'Mustard', + 'Nigella', + 'Nutmeg', + 'Onion Seed', + 'Orange Zest', + 'Oregano', + 'Paella Seasoning', + 'Paprika', + 'Parsley', + 'Pepper', + 'Peppercorns', + 'Pickling Spice', + 'Pimento', + 'Piri Piri Seasoning', + 'Pizza Topping Mix', + 'Poppy Seed', + 'Pot Marjoram', + 'Poudre de Colombo', + 'Ras-el-Hanout', + 'Rice Paper', + 'Rogan Josh Curry', + 'Rogan Josh Mix', + 'Rose Baie', + 'Rosemary', + 'Saffron', + 'Sage', + 'Sea Salt Coarse', + 'Seasoning Salt', + 'Self Adhesive Spice Labels', + 'Sesame Seed', + 'Spearmint', + 'Spice Charts', + 'Steak Seasoning', + 'Sumac', + 'Sweet Basil', + 'Sweet Laurel', + 'Tagine Seasoning', + 'Tandoori Masala', + 'Tandoori Mix', + 'Tarragon', + 'Thai Creen Curry Mix', + 'Thai Red Curry Mix', + 'Thai Stir Fry', + 'Thyme', + 'Tikka Masala', + 'Turmeric', + 'Vanilla', + 'Vegetable Seasoning', + 'Zahtar Spice Mix', +]; diff --git a/src/locales/en/food/vegetable.ts b/src/locales/en/food/vegetable.ts new file mode 100644 index 00000000000..2f52b508108 --- /dev/null +++ b/src/locales/en/food/vegetable.ts @@ -0,0 +1,66 @@ +export default [ + 'Artichoke', + 'Arugula', + 'Asian Greens', + 'Asparagus', + 'Bean Shoots', + 'Bean Sprouts', + 'Beans', + 'Green beans', + 'Beetroot', + 'Bok Choy', + 'Broccoli', + 'Broccolini', + 'Brussels Sprouts', + 'Butternut lettuce', + 'Cabbage', + 'Capers', + 'Carob Carrot', + 'Carrot', + 'Cauliflower', + 'Celery', + 'Chilli Pepper', + 'Chinese Cabbage', + 'Fresh Chillies', + 'Dried Chinese Broccoli', + 'Cornichons', + 'Cos lettuce', + 'Cucumber', + 'Eggplant', + 'Endive', + 'English Spinach', + 'French eschallots', + 'Garlic', + 'Chives', + 'Green Pepper', + 'Hijiki', + 'Iceberg lettuce', + 'Jerusalem Artichoke', + 'Jicama', + 'Kale', + 'Kohlrabi', + 'Leeks', + 'Lettuce', + 'Onion', + 'Okra', + 'Parsnip', + 'Peas', + 'Peppers', + 'Potatoes', + 'Pumpkin', + 'Purple carrot', + 'Radicchio', + 'Radish', + 'Raspberry', + 'Red cabbage', + 'Red Pepper', + 'Rhubarb', + 'Snowpea sprouts', + 'Spinach', + 'Squash', + 'Sun dried tomatoes', + 'Sweet Potato', + 'Swiss Chard', + 'Turnips', + 'Zucchini', +]; diff --git a/src/locales/en/index.ts b/src/locales/en/index.ts index fc45da1fc4e..e325d91a6d9 100644 --- a/src/locales/en/index.ts +++ b/src/locales/en/index.ts @@ -13,6 +13,7 @@ import company from './company'; import database from './database'; import date from './date'; import finance from './finance'; +import food from './food'; import hacker from './hacker'; import internet from './internet'; import location from './location'; @@ -37,6 +38,7 @@ const en: LocaleDefinition = { database, date, finance, + food, hacker, internet, location, From 27cd5e6a66f539d5c153e65d3e1e003b0d7005a4 Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Tue, 17 Oct 2023 21:53:38 +0200 Subject: [PATCH 03/16] test(food): add --- src/locales/en/food/description_pattern.ts | 10 +-- src/locales/en/food/ingredient.ts | 3 - src/modules/food/index.ts | 14 ++-- test.ts | 3 + test/modules/__snapshots__/food.spec.ts.snap | 43 ++++++++++++ test/modules/food.spec.ts | 71 ++++++++++++++++++++ 6 files changed, 129 insertions(+), 15 deletions(-) create mode 100644 test.ts create mode 100644 test/modules/__snapshots__/food.spec.ts.snap create mode 100644 test/modules/food.spec.ts diff --git a/src/locales/en/food/description_pattern.ts b/src/locales/en/food/description_pattern.ts index 88569f35a93..0dc6b55fb81 100644 --- a/src/locales/en/food/description_pattern.ts +++ b/src/locales/en/food/description_pattern.ts @@ -1,9 +1,9 @@ export default [ 'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.', - 'One {{food.ingredient}} with a pinch of {{spice}}, topped by a caramelized {{food.fruit}} with whipped cream', - 'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.', - 'One slice of exotic {{animal.crocodilia}} meat, {{food.spice}} {{foo.spice}} butter, with an additional side.', - '28-day aged 300g {{animal.cow}} steak, with choice of two sides.', + '{{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream', 'A slow-roasted {{animal.bird}} with a crisp, golden exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.', - 'A simple {{food.fruit}} pie. No fancy stuff, just pie.', + 'One slice of exotic {{animal.crocodilia}} meat, {{food.spice}} {{food.spice}} butter, with an additional side.', + '28-day aged 300g {{animal.cow}} steak, with choice of two sides.', + 'A simple {{food.fruit}} pie. No fancy stuff. Just pie.', + 'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.', ]; diff --git a/src/locales/en/food/ingredient.ts b/src/locales/en/food/ingredient.ts index e7045ebff50..52b7dbbeac1 100644 --- a/src/locales/en/food/ingredient.ts +++ b/src/locales/en/food/ingredient.ts @@ -12,7 +12,6 @@ export default [ 'Amaranth', 'Amchur', 'Anchovies', - 'Anchovies', 'Aniseed', 'Annatto Seed', 'Apple Cider Vinegar', @@ -20,7 +19,6 @@ export default [ 'Apple Juice Concentrate', 'Apples', 'Bonza', - 'Apples', 'Apricots', 'Arborio Rice', 'Arrowroot', @@ -206,7 +204,6 @@ export default [ 'Galangal', 'Garam Masala', 'Garlic', - 'Chives', 'Goat Cheese', 'Goat Milk', 'Goji Berry', diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index b9fa6c2b607..47c79715d98 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -10,7 +10,7 @@ export class FoodModule { * @example * faker.food.description() // 'Lasagne' * - * @since v8.3.0 + * @since 8.3.0 */ description(): string { return this.faker.helpers.fake( @@ -24,7 +24,7 @@ export class FoodModule { * @example * faker.food.dish() // 'Lasagne' * - * @since v8.3.0 + * @since 8.3.0 */ dish(): string { return this.faker.helpers.arrayElement(this.faker.definitions.food.dish); @@ -34,7 +34,7 @@ export class FoodModule { * @example * faker.food.ethnicCategory() // 'Lasagne' * - * @since v8.3.0 + * @since 8.3.0 */ ethnicCategory(): string { return this.faker.helpers.arrayElement( @@ -46,7 +46,7 @@ export class FoodModule { * @example * faker.food.fruit() // 'Lemon' * - * @since v8.3.0 + * @since 8.3.0 */ fruit(): string { return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit); @@ -56,7 +56,7 @@ export class FoodModule { * @example * faker.food.ingredient() // 'Butter' * - * @since v8.3.0 + * @since 8.3.0 */ ingredient(): string { return this.faker.helpers.arrayElement( @@ -68,7 +68,7 @@ export class FoodModule { * @example * faker.food.spice() // 'Chilli' * - * @since v8.3.0 + * @since 8.3.0 */ spice(): string { return this.faker.helpers.arrayElement(this.faker.definitions.food.spice); @@ -78,7 +78,7 @@ export class FoodModule { * @example * faker.food.vegetable() // 'Broccoli' * - * @since v8.3.0 + * @since 8.3.0 */ vegetable(): string { return this.faker.helpers.arrayElement( diff --git a/test.ts b/test.ts new file mode 100644 index 00000000000..12dbc9fe23f --- /dev/null +++ b/test.ts @@ -0,0 +1,3 @@ +import { faker } from './src'; + +console.log(faker.helpers.multiple(faker.food.description, { count: 20 })); diff --git a/test/modules/__snapshots__/food.spec.ts.snap b/test/modules/__snapshots__/food.spec.ts.snap new file mode 100644 index 00000000000..d5953b8d50d --- /dev/null +++ b/test/modules/__snapshots__/food.spec.ts.snap @@ -0,0 +1,43 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`food > 42 > description 1`] = `"A slow-roasted Bachman's Warbler with a crisp, golden exterior. Stuffed with Sultanas and covered in Cavalo sauce. Sides with Peppers puree and wild Purple carrot."`; + +exports[`food > 42 > dish 1`] = `"Katsu Curry"`; + +exports[`food > 42 > ethnicCategory 1`] = `"Gujarati"`; + +exports[`food > 42 > fruit 1`] = `"Feijoa"`; + +exports[`food > 42 > ingredient 1`] = `"Fish Sauce"`; + +exports[`food > 42 > spice 1`] = `"Five Spice Mix"`; + +exports[`food > 42 > vegetable 1`] = `"Dried Chinese Broccoli"`; + +exports[`food > 1211 > description 1`] = `"A special turquoise Sunflower Seeds from San Marino. To support the strong flavor it is sided with a tablespoon of Chillies."`; + +exports[`food > 1211 > dish 1`] = `"Teriyaki Chicken Donburi"`; + +exports[`food > 1211 > ethnicCategory 1`] = `"Thai"`; + +exports[`food > 1211 > fruit 1`] = `"Strawberries"`; + +exports[`food > 1211 > ingredient 1`] = `"Tofu"`; + +exports[`food > 1211 > spice 1`] = `"Tarragon"`; + +exports[`food > 1211 > vegetable 1`] = `"Sun dried tomatoes"`; + +exports[`food > 1337 > description 1`] = `"Macadamia Oil with a pinch of Cardamom, topped by a caramelized Cherries with whipped cream"`; + +exports[`food > 1337 > dish 1`] = `"Ebiten maki"`; + +exports[`food > 1337 > ethnicCategory 1`] = `"Czech"`; + +exports[`food > 1337 > fruit 1`] = `"Currants"`; + +exports[`food > 1337 > ingredient 1`] = `"Cinnamon"`; + +exports[`food > 1337 > spice 1`] = `"Cloves"`; + +exports[`food > 1337 > vegetable 1`] = `"Carob Carrot"`; diff --git a/test/modules/food.spec.ts b/test/modules/food.spec.ts new file mode 100644 index 00000000000..e6250f62357 --- /dev/null +++ b/test/modules/food.spec.ts @@ -0,0 +1,71 @@ +import { describe, expect, it } from 'vitest'; +import { faker } from '../../src'; +import { seededTests } from '../support/seededRuns'; +import { times } from '../support/times'; + +const NON_SEEDED_BASED_RUN = 5; + +describe('food', () => { + seededTests(faker, 'food', (t) => { + t.it('description'); + + t.it('dish'); + + t.it('ethnicCategory'); + + t.it('fruit'); + + t.it('ingredient'); + + t.it('spice'); + + t.it('vegetable'); + }); + + describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))( + 'random seeded tests for seed %i', + () => { + describe('dish', () => { + it(`should return random value from dish array`, () => { + const actual = faker.food.dish(); + expect(faker.definitions.food.dish).toContain(actual); + }); + }); + + describe('ethnicCategory', () => { + it(`should return random value from ethnic_category array`, () => { + const actual = faker.food.ethnicCategory(); + expect(faker.definitions.food.ethnic_category).toContain(actual); + }); + }); + + describe('fruit', () => { + it(`should return random value from fruit array`, () => { + const actual = faker.food.fruit(); + expect(faker.definitions.food.fruit).toContain(actual); + }); + }); + + describe('ingredient', () => { + it(`should return random value from ingredient array`, () => { + const actual = faker.food.ingredient(); + expect(faker.definitions.food.ingredient).toContain(actual); + }); + }); + + describe('spice', () => { + it(`should return random value from spice array`, () => { + const actual = faker.food.spice(); + expect(faker.definitions.food.spice).toContain(actual); + }); + }); + + describe('vegetable', () => { + it(`should return random value from vegetable array`, () => { + const actual = faker.food.vegetable(); + expect(faker.definitions.food.vegetable).toContain(actual); + }); + }); + } + ); +}); From 40ded56966627d33c58865ef1323fbc763d58218 Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Tue, 17 Oct 2023 21:57:05 +0200 Subject: [PATCH 04/16] docs: add food to api page --- docs/.vitepress/api-pages.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/.vitepress/api-pages.ts b/docs/.vitepress/api-pages.ts index dad86954967..170df0d2673 100644 --- a/docs/.vitepress/api-pages.ts +++ b/docs/.vitepress/api-pages.ts @@ -13,6 +13,7 @@ export const apiPages = [ { text: 'Datatype', link: '/api/datatype.html' }, { text: 'Date', link: '/api/date.html' }, { text: 'Finance', link: '/api/finance.html' }, + { text: 'Food', link: '/api/food.html' }, { text: 'Git', link: '/api/git.html' }, { text: 'Hacker', link: '/api/hacker.html' }, { text: 'Helpers', link: '/api/helpers.html' }, From 3e10b7803834af6267b6c9cde19046b642a9c340 Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Tue, 17 Oct 2023 22:13:23 +0200 Subject: [PATCH 05/16] docs: add basic JSDocs --- src/modules/food/index.ts | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index 47c79715d98..daaab09a696 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -1,14 +1,24 @@ import type { Faker } from '../../faker'; import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; +/** + * Module for generating food-related data. + * + * ### Overview + * + * This module provides methods to generate various food-related information, such as [dish names](https://fakerjs.dev/api/food.html#dish), [spices](https://fakerjs.dev/api/food.html#spice) or [vegetables](https://fakerjs.dev/api/food.html#vegetable). + * To generate descriptions for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). + */ export class FoodModule { constructor(private readonly faker: Faker) { bindThisToMemberFunctions(this); } /** + * Generates a random dish description. + * * @example - * faker.food.description() // 'Lasagne' + * faker.food.description() // 'Three Coconut Water with Pumpkin, Turnips, Peppers, Raspberry and Coffee. With a side of baked Apricots, and your choice of Pineapple or Kidney Beans' * * @since 8.3.0 */ @@ -31,8 +41,10 @@ export class FoodModule { } /** + * Generates a random food's ethnic category. + * * @example - * faker.food.ethnicCategory() // 'Lasagne' + * faker.food.ethnicCategory() // 'Italian' * * @since 8.3.0 */ @@ -43,6 +55,8 @@ export class FoodModule { } /** + * Generates a random fruit name. + * * @example * faker.food.fruit() // 'Lemon' * @@ -53,6 +67,8 @@ export class FoodModule { } /** + * Generates a random ingredient name. + * * @example * faker.food.ingredient() // 'Butter' * @@ -65,6 +81,8 @@ export class FoodModule { } /** + * Generates a random spice name. + * * @example * faker.food.spice() // 'Chilli' * @@ -75,6 +93,8 @@ export class FoodModule { } /** + * Generates a random spice name. + * * @example * faker.food.vegetable() // 'Broccoli' * From 8d8f704edfcd7f7c1b830bb6227837a6530221ba Mon Sep 17 00:00:00 2001 From: xDivisionByZerox Date: Wed, 18 Oct 2023 00:10:13 +0200 Subject: [PATCH 06/16] chore: remove accidental committed file --- test.ts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 test.ts diff --git a/test.ts b/test.ts deleted file mode 100644 index 12dbc9fe23f..00000000000 --- a/test.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { faker } from './src'; - -console.log(faker.helpers.multiple(faker.food.description, { count: 20 })); From a5d743c40f5efaeaabd757c62eeb3c6a5480bb88 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Fri, 19 Jan 2024 20:34:00 +0700 Subject: [PATCH 07/16] new definitions and methods - add new definitions for adjective, dish_pattern and meat - add more description patterns - make most definitions lower case and singular - alphabeticize definitions --- src/definitions/food.ts | 15 + src/locales/en/food/adjective.ts | 22 + src/locales/en/food/description_pattern.ts | 24 +- src/locales/en/food/dish.ts | 108 +-- src/locales/en/food/dish_pattern.ts | 17 + src/locales/en/food/ethnic_category.ts | 34 +- src/locales/en/food/fruit.ts | 138 +-- src/locales/en/food/index.ts | 6 + src/locales/en/food/ingredient.ts | 970 ++++++++++----------- src/locales/en/food/meat.ts | 18 + src/locales/en/food/spice.ts | 228 +++-- src/locales/en/food/vegetable.ts | 128 +-- src/modules/food/index.ts | 69 +- 13 files changed, 936 insertions(+), 841 deletions(-) create mode 100644 src/locales/en/food/adjective.ts create mode 100644 src/locales/en/food/dish_pattern.ts create mode 100644 src/locales/en/food/meat.ts diff --git a/src/definitions/food.ts b/src/definitions/food.ts index 0a5dbe3d0bb..99cee8e349c 100644 --- a/src/definitions/food.ts +++ b/src/definitions/food.ts @@ -1,6 +1,11 @@ import type { LocaleEntry } from './definitions'; export type FoodDefinition = LocaleEntry<{ + /** + * Common food adjectives. + */ + adjective: string[]; + /** * List of description patterns. */ @@ -11,6 +16,11 @@ export type FoodDefinition = LocaleEntry<{ */ dish: string[]; + /** + * List of dish patterns. + */ + dish_pattern: string[]; + /** * A list of cooking styles that are commonly associated with a particular food item or recipe. */ @@ -26,6 +36,11 @@ export type FoodDefinition = LocaleEntry<{ */ ingredient: string[]; + /** + * Common meat names. + */ + meat: string[]; + /** * A list of common spice names. */ diff --git a/src/locales/en/food/adjective.ts b/src/locales/en/food/adjective.ts new file mode 100644 index 00000000000..e50a9fbdd79 --- /dev/null +++ b/src/locales/en/food/adjective.ts @@ -0,0 +1,22 @@ +export default [ + 'bitter', + 'creamy', + 'crispy', + 'crunchy', + 'delicious', + 'fluffy', + 'fresh', + 'golden', + 'juicy', + 'moist', + 'rich', + 'salty', + 'savory', + 'smoky', + 'sour', + 'spicy', + 'sweet', + 'tangy', + 'tender', + 'zesty', +]; diff --git a/src/locales/en/food/description_pattern.ts b/src/locales/en/food/description_pattern.ts index 0dc6b55fb81..848a0c7211a 100644 --- a/src/locales/en/food/description_pattern.ts +++ b/src/locales/en/food/description_pattern.ts @@ -1,9 +1,23 @@ export default [ - 'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.', - '{{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream', - 'A slow-roasted {{animal.bird}} with a crisp, golden exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.', - 'One slice of exotic {{animal.crocodilia}} meat, {{food.spice}} {{food.spice}} butter, with an additional side.', - '28-day aged 300g {{animal.cow}} steak, with choice of two sides.', + 'A classic pie filled with delicious {{food.meat}} and {{food.adjective}} {{food.ingredient}}, baked in a {{food.adjective}} pastry crust and topped with a golden-brown lattice.', + 'A delightful tart combining {{food.adjective}} {{food.vegetable}} and sweet {{food.fruit}}, set in a buttery pastry shell and finished with a hint of {{food.spice}}.', + 'A heartwarming {{food.ethnic_category}} soup, featuring fresh {{food.ingredient}} and an aromatic blend of traditional spices.', + 'A robust {{food.adjective}} stew featuring {{food.ethnic_category}} flavors, loaded with {{food.adjective}} meat, {{food.adjective}} vegetables, and a {{food.adjective}}, {{food.adjective}} broth.', 'A simple {{food.fruit}} pie. No fancy stuff. Just pie.', + 'A slow-roasted {{animal.bird}} with a {{food.adjective}}, {{food.adjective}} exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.', 'A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.', + 'A succulent {{food.meat}} steak, encased in a {{food.adjective}} {{food.spice}} crust, served with a side of {{food.spice}} mashed {{food.vegetable}}.', + 'An exquisite {{food.meat}} roast, infused with the essence of {{food.fruit}}, slow-roasted to bring out its natural flavors and served with a side of creamy {{food.vegetable}}', + 'Baked {{food.ingredient}}-stuffed {{food.meat}}, seasoned with {{food.spice}} and {{food.adjective}} herbs, accompanied by roasted {{food.vegetable}} medley.', + 'Crispy fried {{food.meat}} bites, seasoned with {{food.spice}} and served with a tangy {{food.fruit}} dipping sauce.', + 'Fresh mixed greens tossed with {{food.spice}}-rubbed {{food.meat}}, {{food.vegetable}}, and a light dressing.', + 'Grilled {{food.meat}} kebabs, marinated in {{food.ethnic_category}} spices and served with a fresh {{food.vegetable}} and {{food.fruit}} salad.', + 'Hearty {{food.ingredient}} and {{food.meat}} stew, slow-cooked with {{food.spice}} and {{food.vegetable}} for a comforting, flavorful meal.', + 'Juicy {{food.meat}}, grilled to your liking and drizzled with a bold {{food.spice}} sauce, served alongside roasted {{food.vegetable}}.', + 'Our {{food.adjective}} {{food.meat}}, slow-cooked to perfection, accompanied by steamed {{food.vegetable}} and a rich, savory gravy.', + 'Tender {{food.meat}} skewers, glazed with a sweet and tangy {{food.fruit}} sauce, served over a bed of fragrant jasmine rice.', + 'Tenderly braised {{food.meat}} in a rich {{food.spice}} and {{food.vegetable}} sauce, served with a side of creamy {{food.vegetable}}.', + 'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.', + '{{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream', + '{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":1, "max":3})}} sides.', ]; diff --git a/src/locales/en/food/dish.ts b/src/locales/en/food/dish.ts index cbf716f8313..ef544310585 100644 --- a/src/locales/en/food/dish.ts +++ b/src/locales/en/food/dish.ts @@ -1,56 +1,56 @@ export default [ - 'Arepas', - 'Barbecue Ribs', - 'Bruschette with Tomato', - 'Bunny Chow', - 'Caesar Salad', - 'California Maki', - 'Caprese Salad', - 'Cauliflower Penne', - 'Cheeseburger', - 'Chicken Fajitas', - 'Chicken Milanese', - 'Chicken Parm', - 'Chicken Wings', - 'Chilli con Carne', - 'Ebiten maki', - 'Fettuccine Alfredo', - 'Fish and Chips', - 'French Fries with Sausages', - 'French Toast', - 'Hummus', - 'Katsu Curry', - 'Kebab', - 'Lasagne', - 'Linguine with Clams', - 'Massaman Curry', - 'Meatballs with Sauce', - 'Mushroom Risotto', - 'Pappardelle alla Bolognese', - 'Pasta Carbonara', - 'Pasta and Beans', - 'Pasta with Tomato and Basil', - 'Peking Duck', - 'Philadelphia Maki', - 'Pho', - 'Pierogi', - 'Pizza', - 'Poke', - 'Pork Belly Buns', - 'Pork Sausage Roll', - 'Poutine', - 'Ricotta Stuffed Ravioli', - 'Risotto with Seafood', - 'Salmon Nigiri', - 'Scotch Eggs', - 'Seafood Paella', - 'Som Tam', - 'Souvlaki', - 'Stinky Tofu', - 'Sushi', - 'Tacos', - 'Teriyaki Chicken Donburi', - 'Tiramisù', - 'Tuna Sashimi', - 'Vegetable Soup', + 'California maki', + 'Peking duck', + 'Philadelphia maki', + 'arepas', + 'barbecue ribs', + 'bruschette with tomato', + 'bunny chow', + 'caesar salad', + 'caprese salad', + 'cauliflower penne', + 'cheeseburger', + 'chicken fajitas', + 'chicken milanese', + 'chicken parm', + 'chicken wings', + 'chilli con carne', + 'ebiten maki', + 'fettuccine alfredo', + 'fish and chips', + 'french fries with sausages', + 'french toast', + 'hummus', + 'katsu curry', + 'kebab', + 'lasagne', + 'linguine with clams', + 'massaman curry', + 'meatballs with sauce', + 'mushroom risotto', + 'pappardelle alla bolognese', + 'pasta and beans', + 'pasta carbonara', + 'pasta with tomato and basil', + 'pho', + 'pierogi', + 'pizza', + 'poke', + 'pork belly buns', + 'pork sausage roll', + 'poutine', + 'ricotta stuffed ravioli', + 'risotto with seafood', + 'salmon nigiri', + 'scotch eggs', + 'seafood paella', + 'som tam', + 'souvlaki', + 'stinky tofu', + 'sushi', + 'tacos', + 'teriyaki chicken donburi', + 'tiramisù', + 'tuna sashimi', + 'vegetable soup', ]; diff --git a/src/locales/en/food/dish_pattern.ts b/src/locales/en/food/dish_pattern.ts new file mode 100644 index 00000000000..8bb76038c27 --- /dev/null +++ b/src/locales/en/food/dish_pattern.ts @@ -0,0 +1,17 @@ +export default [ + '{{food.adjective}} {{food.ethnic_category}} stew', + '{{food.adjective}} {{food.meat}} with {{food.vegetable}}', + '{{food.ethnic_category}} {{food.ingredient}} soup', + '{{food.fruit}} and {{food.fruit}} tart', + '{{food.fruit}} pie', + '{{food.fruit}}-glazed {{food.meat}} skewers', + '{{food.fruit}}-infused {{food.meat}} roast', + '{{food.ingredient}} and {{food.meat}} pie', + '{{food.ingredient}}-infused {{food.meat}}', + '{{food.meat}} steak', + '{{food.meat}} with {{food.fruit}} sauce', + '{{food.spice}}-crusted {{food.meat}}', + '{{food.spice}}-rubbed {{food.meat}} salad', + '{{food.vegetable}} salad', + "{{person.first_name}}'s special {{food.ingredient}}", +]; diff --git a/src/locales/en/food/ethnic_category.ts b/src/locales/en/food/ethnic_category.ts index 0413a433a72..50611834808 100644 --- a/src/locales/en/food/ethnic_category.ts +++ b/src/locales/en/food/ethnic_category.ts @@ -1,19 +1,19 @@ export default [ 'Ainu', 'Albanian', - 'Argentine', - 'Andhra', 'American', + 'Andhra', 'Anglo-Indian', 'Arab', + 'Argentine', 'Armenian', 'Assyrian', 'Awadhi', 'Azerbaijani', 'Balochi', + 'Bangladeshi', 'Bashkir', 'Belarusian', - 'Bangladeshi', 'Bengali', 'Berber', 'Brazilian', @@ -24,7 +24,7 @@ export default [ 'Cantonese', 'Caribbean', 'Chechen', - 'Chinese cuisine', + 'Chinese', 'Chinese Islamic', 'Circassian', 'Crimean Tatar', @@ -33,11 +33,11 @@ export default [ 'Danish', 'Egyptian', 'English', - 'Ethiopian', 'Eritrean', 'Estonian', - 'French', + 'Ethiopian', 'Filipino', + 'French', 'Georgian', 'German', 'Goan', @@ -45,14 +45,14 @@ export default [ 'Greek', 'Gujarati', 'Hyderabad', - 'Indian cuisine', + 'Indian', 'Indian Chinese', - 'Indian Singaporean cuisine', + 'Indian Singaporean', 'Indonesian', 'Inuit', 'Irish', + 'Italian', 'Italian-American', - 'Italian cuisine', 'Jamaican', 'Japanese', 'Jewish - Israeli', @@ -62,16 +62,16 @@ export default [ 'Korean', 'Kurdish', 'Laotian', - 'Lebanese', 'Latvian', + 'Lebanese', 'Lithuanian', 'Louisiana Creole', 'Maharashtrian', - 'Mangalorean', 'Malay', - 'Malaysian Chinese cuisine', - 'Malaysian Indian cuisine', - 'Mediterranean cuisine', + 'Malaysian Chinese', + 'Malaysian Indian', + 'Mangalorean', + 'Mediterranean', 'Mennonite', 'Mexican', 'Mordovian', @@ -80,14 +80,14 @@ export default [ 'Nepalese', 'New Mexican', 'Odia', + 'Pakistani', 'Parsi', 'Pashtun', - 'Polish', 'Pennsylvania Dutch', - 'Pakistani', 'Peranakan', 'Persian', 'Peruvian', + 'Polish', 'Portuguese', 'Punjabi', 'Québécois', @@ -106,11 +106,11 @@ export default [ 'Spanish', 'Sri Lankan', 'Taiwanese', + 'Tamil', 'Tatar', 'Texan', 'Thai', 'Turkish', - 'Tamil', 'Udupi', 'Ukrainian', 'Vietnamese', diff --git a/src/locales/en/food/fruit.ts b/src/locales/en/food/fruit.ts index 1b45db16b5d..e593a09ff65 100644 --- a/src/locales/en/food/fruit.ts +++ b/src/locales/en/food/fruit.ts @@ -1,71 +1,71 @@ export default [ - 'Apples', - 'Apricots', - 'Aubergine', - 'Avocado', - 'Banana', - 'Berries', - 'Blackberries', - 'Blood oranges', - 'Blueberries', - 'Bush Tomato', - 'Butternut pumpkin', - 'Cantaloupe', - 'Cavalo', - 'Starfruit', - 'Cherries', - 'Corella Pear', - 'Cranberry', - 'Cumquat', - 'Currants', - 'Custard Apples', - 'Custard Apples Daikon', - 'Dates', - 'Dragonfruit', - 'Dried Apricots', - 'Elderberry', - 'Feijoa', - 'Grapefruit', - 'Grapes', - 'Figs', - 'Fingerlime', - 'Goji Berry', - 'Guava', - 'Honeydew melon', - 'Incaberries', - 'Jarrahdale pumpkin', - 'Juniper Berries', - 'Kiwi Fruit', - 'Kiwiberries', - 'Lemon', - 'Limes', - 'Longan', - 'Loquats', - 'Lychees', - 'Mango', - 'Mangosteens', - 'Melon', - 'Mandarins', - 'Mulberries', - 'Nashi Pear', - 'Nectarines', - 'Olives', - 'Oranges', - 'Papaw', - 'Papaya', - 'Passionfruit', - 'Peaches', - 'Pears', - 'Pineapple', - 'Pomegranate', - 'Plums', - 'Prunes', - 'Rockmelon', - 'Snowpeas', - 'Sprouts', - 'Strawberries', - 'Sultanas', - 'Tangelo', - 'Tomatoes', - 'Watermelon', + 'apple', + 'apricot', + 'aubergine', + 'avocado', + 'banana', + 'berry', + 'blackberry', + 'blood orange', + 'blueberry', + 'bush tomato', + 'butternut pumpkin', + 'cantaloupe', + 'cavalo', + 'cherry', + 'corella pear', + 'cranberry', + 'cumquat', + 'currant', + 'custard apple', + 'custard apples daikon', + 'date', + 'dragonfruit', + 'dried apricot', + 'elderberry', + 'feijoa', + 'fig', + 'fingerlime', + 'goji berry', + 'grape', + 'grapefruit', + 'guava', + 'honeydew melon', + 'incaberry', + 'jarrahdale pumpkin', + 'juniper berry', + 'kiwi fruit', + 'kiwiberry', + 'lemon', + 'lime', + 'longan', + 'loquat', + 'lychee', + 'mandarin', + 'mango', + 'mangosteen', + 'melon', + 'mulberry', + 'nashi pear', + 'nectarine', + 'olive', + 'orange', + 'papaw', + 'papaya', + 'passionfruit', + 'peache', + 'pear', + 'pineapple', + 'plum', + 'pomegranate', + 'prune', + 'rockmelon', + 'snowpea', + 'sprout', + 'starfruit', + 'strawberry', + 'sultana', + 'tangelo', + 'tomato', + 'watermelon', ]; diff --git a/src/locales/en/food/index.ts b/src/locales/en/food/index.ts index a3668e5740b..65e4b8a870c 100644 --- a/src/locales/en/food/index.ts +++ b/src/locales/en/food/index.ts @@ -3,20 +3,26 @@ * Run 'pnpm run generate:locales' to update. */ import type { FoodDefinition } from '../../..'; +import adjective from './adjective'; import description_pattern from './description_pattern'; import dish from './dish'; +import dish_pattern from './dish_pattern'; import ethnic_category from './ethnic_category'; import fruit from './fruit'; import ingredient from './ingredient'; +import meat from './meat'; import spice from './spice'; import vegetable from './vegetable'; const food: FoodDefinition = { + adjective, description_pattern, dish, + dish_pattern, ethnic_category, fruit, ingredient, + meat, spice, vegetable, }; diff --git a/src/locales/en/food/ingredient.ts b/src/locales/en/food/ingredient.ts index 52b7dbbeac1..ba061184475 100644 --- a/src/locales/en/food/ingredient.ts +++ b/src/locales/en/food/ingredient.ts @@ -1,487 +1,487 @@ export default [ - 'Achacha', - 'Adzuki Beans', - 'Agar', - 'Agave Syrup', - 'Ajowan Seed', - 'Albacore Tuna', - 'Alfalfa', - 'Allspice', - 'Almond Oil', - 'Almonds', - 'Amaranth', - 'Amchur', - 'Anchovies', - 'Aniseed', - 'Annatto Seed', - 'Apple Cider Vinegar', - 'Apple Juice', - 'Apple Juice Concentrate', - 'Apples', - 'Bonza', - 'Apricots', - 'Arborio Rice', - 'Arrowroot', - 'Artichoke', - 'Arugula', - 'Asafoetida', - 'Asian Greens', - 'Asian Noodles', - 'Asparagus', - 'Aubergine', - 'Avocado', - 'Avocado Oil', - 'Avocado Spread', - 'Bacon', - 'Baking Powder', - 'Baking Soda', - 'Balsamic Vinegar', - 'Bamboo Shoots', - 'Banana', - 'Barberry', - 'Barley', - 'Barramundi', - 'Basil Basmati Rice', - 'Bay Leaves', - 'Bean Shoots', - 'Bean Sprouts', - 'Beans', - 'Green Beans', - 'Beef', - 'Beetroot', - 'Berries', - 'Black Eyed Beans', - 'Blackberries', - 'Blood Oranges', - 'Blue Cheese', - 'Blue Eye Trevalla', - 'Blue Swimmer Crab', - 'Blueberries', - 'Bocconcini', - 'Bok Choy', - 'Bonito Flakes', - 'Borlotti Beans', - 'Brazil Nut', - 'Bran', - 'Bread', - 'Rye Bread', - 'Sour Dough Bread', - 'Spelt Bread', - 'White Bread', - 'Wholegrain Bread', - 'Wholemeal', - 'Brie', - 'Broccoli', - 'Broccolini', - 'Brown Rice', - 'Brown Rice Vinegar', - 'Brussels Sprouts', - 'Buckwheat', - 'Buckwheat Noodles', - 'Bulghur', - 'Bush Tomato', - 'Butter', - 'Butter Beans', - 'Buttermilk', - 'Butternut Lettuce', - 'Butternut Pumpkin', - 'Cabbage', - 'Cacao', - 'Cake', - 'Calamari', - 'Camellia Tea Oil', - 'Camembert', - 'Camomile', - 'Candle Nut', - 'Cannellini Beans', - 'Canola Oil', - 'Cantaloupe', - 'Capers', - 'Capsicum', - 'Starfruit', - 'Caraway Seed', - 'Cardamom', - 'Carob Carrot', - 'Carrot', - 'Cashews', - 'Cassia bark', - 'Cauliflower', - 'Cavalo', - 'Cayenne', - 'Celery', - 'Celery Seed', - 'Cheddar', - 'Cherries', - 'Chestnut', - 'Chia Seeds', - 'Chicken', - 'Chickory', - 'Chickpea', - 'Chilli Pepper', - 'Fresh Chillies', - 'Dried Chinese Broccoli', - 'Chinese Cabbage', - 'Chinese Five Spice', - 'Chives', - 'Dark Chocolate', - 'Milk Chocolate', - 'Choy Sum', - 'Cinnamon', - 'Clams', - 'Cloves', - 'Cocoa Powder', - 'Coconut', - 'Coconut Oil', - 'Coconut Water', - 'Coffee', - 'Corella Pear', - 'Coriander Leaves', - 'Coriander Seed', - 'Corn Oil', - 'Corn Syrup', - 'Corn Tortilla', - 'Cornichons', - 'Cornmeal', - 'Cos Lettuce', - 'Cottage Cheese', - 'Cous Cous', - 'Crabs', - 'Cranberry', - 'Cream', - 'Cream Cheese', - 'Cucumber', - 'Cumin', - 'Cumquat', - 'Currants', - 'Curry Leaves', - 'Curry Powder', - 'Custard Apples', - 'Dandelion', - 'Dashi', - 'Dates', - 'Dill', - 'Dragonfruit', - 'Dried Apricots', - 'Duck', - 'Edam', - 'Edamame', - 'Eggplant', - 'Eggs', - 'Elderberry', - 'Endive', - 'English Spinach', - 'Extra Virgin Olive Oil', - 'Farmed Prawns', - 'Feijoa', - 'Fennel', - 'Fennel Seeds', - 'Fenugreek', - 'Feta', - 'Figs', - 'File Powder', - 'Fingerlime', - 'Fish Sauce', - 'Flathead', - 'Flaxseed', - 'Flaxseed Oil', - 'Flounder', - 'Flour', - 'Besan', - 'Buckwheat Flour', - 'Oat Flour', - 'Potato Flour', - 'Rice Flour', - 'Brown Flour', - 'White Flour', - 'Soy Flour', - 'Tapioca Flour', - 'Unbleached Flour', - 'Wholewheat Flour', - 'Freekeh', - 'French Eschallots', - 'Fromage Blanc', - 'Fruit', - 'Galangal', - 'Garam Masala', - 'Garlic', - 'Goat Cheese', - 'Goat Milk', - 'Goji Berry', - 'Grape Seed Oil', - 'Grapefruit', - 'Grapes', - 'Green Pepper', - 'Green Tea', - 'Green Tea Noodles', - 'Greenwheat Freekeh', - 'Gruyere', - 'Guava', - 'Gula Melaka', - 'Haloumi', - 'Ham', - 'Haricot Beans', - 'Harissa', - 'Hazelnut', - 'Hijiki', - 'Hiramasa Kingfish', - 'Hokkien Noodles', - 'Honey', - 'Honeydew Melon', - 'Horseradish', - 'Hot Smoked Salmon', - 'Hummus', - 'Iceberg Lettuce', - 'Incaberries', - 'Jarrahdale Pumpkin', - 'Jasmine Rice', - 'Jelly', - 'Jerusalem Artichoke', - 'Jewfish', - 'Jicama', - 'Juniper Berries', - 'Lime Leaves', - 'Kale', - 'Kangaroo', - 'Kecap Manis', - 'Kenchur', - 'Kidney Beans', - 'Kidneys', - 'Kiwi Fruit', - 'Kiwi Berries', - 'Kohlrabi', - 'Kokam', - 'Kombu', - 'Koshihikari Rice', - 'Kudzu', - 'Kumera', - 'Lamb', - 'Lavender Flowers', - 'Leeks', - 'Lemon', - 'Lemongrass', - 'Lentils', - 'Lettuce', - 'Licorice', - 'Limes', - 'Liver', - 'Lobster', - 'Longan', - 'Loquats', - 'Lotus Root', - 'Lychees', - 'Macadamia Nut', - 'Macadamia Oil', - 'Mace', - 'Mackerel', - 'Tinned', - 'Mahi Mahi', - 'Mahlab', - 'Malt Vinegar', - 'Mandarins', - 'Mango', - 'Mangosteens', - 'Maple Syrup', - 'Margarine', - 'Marigold', - 'Marjoram', - 'Mastic', - 'Melon', - 'Milk', - 'Mint', - 'Miso', - 'Molasses', - 'Monkfish', - 'Morwong', - 'Mountain Bread', - 'Mozzarella', - 'Muesli', - 'Mulberries', - 'Mullet', - 'Mung Beans', - 'Flat Mushrooms', - 'Brown Mushrooms', - 'Common Cultivated Mushrooms', - 'Enoki Mushrooms', - 'Oyster Mushrooms', - 'Shiitake Mushrooms', - 'Mussels', - 'Mustard', - 'Mustard Seed', - 'Nashi Pear', - 'Nasturtium', - 'Nectarines', - 'Nori', - 'Nutmeg', - 'Nutritional Yeast', - 'Nuts', - 'Oatmeal', - 'Oats', - 'Octopus', - 'Okra', - 'Olive Oil', - 'Olives', - 'Omega Spread', - 'Onion', - 'Oranges', - 'Oregano', - 'Oyster Sauce', - 'Oysters', - 'Pear', - 'Pandanus Leaves', - 'Papaw', - 'Papaya', - 'Paprik', - 'Parmesan Cheese', - 'Parrotfish', - 'Parsley', - 'Parsnip', - 'Passionfruit', - 'Pasta', - 'Peaches', - 'Peanuts', - 'Pear Juice', - 'Pears', - 'Peas', - 'Pecan Nut', - 'Pecorino', - 'Pepitas', - 'Szechuan Pepperberry', - 'Peppercorns', - 'Peppermint', - 'Peppers', - 'Persimmon', - 'Pine Nut', - 'Pineapple', - 'Pinto Beans', - 'Pistachio Nut', - 'Plums', - 'Polenta', - 'Pomegranate', - 'Poppy Seed', - 'Porcini Mushrooms', - 'Pork', - 'Potatoes', - 'Provolone', - 'Prunes', - 'Pumpkin', - 'Pumpkin Seed', - 'Purple Carrot', - 'Purple Rice', - 'Quark Quinc', - 'Quinoa', - 'Radicchio', - 'Radish', - 'Raisin', - 'Raspberry', - 'Red Cabbage', - 'Red Lentils', - 'Red Pepper', - 'Red Wine Vinegar', - 'Redfish', - 'Rhubarb', - 'Rice Noodles', - 'Rice Paper', - 'Rice Syrup', - 'Ricemilk', - 'Ricotta', - 'Rockmelon', - 'Rose Water', - 'Rosemary', - 'Rye', - 'Safflower Oil', - 'Saffron', - 'Sage', - 'Sake', - 'Salmon', - 'Sardines', - 'Sausages', - 'Scallops', - 'Sea Salt', - 'Semolina', - 'Sesame Oil', - 'Sesame Seeds', - 'Shark', - 'Silverbeet', - 'Slivered Almonds', - 'Smoked Trout', - 'Snapper', - 'Snowpea sprouts', - 'Snowpeas', - 'Soba', - 'Soy Beans', - 'Soy Milk', - 'Soy Sauce', - 'Soy', - 'Sprouts', - 'Soymilk', - 'Spearmint', - 'Spelt', - 'Spinach', - 'Spring Onions', - 'Squash', - 'Squid', - 'Star Anise', - 'Star Fruit', - 'Stevia', - 'Beef Stock', - 'Chicken Stock', - 'Fish Stock', - 'Vegetable Stock', - 'Strawberries', - 'Sugar', - 'Sultanas', - 'Sun-Dried Tomatoes', - 'Sunflower Oil', - 'Sunflower Seeds', - 'Sweet Chilli Sauce', - 'Sweet Potato', - 'Swiss Chard', - 'Swordfish', - 'Tabasco', - 'Tahini', - 'Taleggio Cheese', - 'Tamari', - 'Tamarillo', - 'Tangelo', - 'Tapioca', - 'Tarragon', - 'Tea', - 'Tea Oil', - 'Tempeh', - 'Thyme', - 'Tofu', - 'Tom Yum', - 'Tomatoes', - 'Trout', - 'Tuna', - 'Turkey', - 'Turmeric', - 'Turnips', - 'Vanilla Beans', - 'Vegetable Oil', - 'Vegetable Spaghetti', - 'Vermicelli Noodles', - 'Vinegar', - 'Wakame', - 'Walnut', - 'Warehou', - 'Wasabi', - 'Water', - 'Watercress', - 'Watermelon', - 'Wattleseed', - 'Wheat', - 'Wheatgrass Juice', - 'White rice', - 'White Wine Vinegar', - 'Whiting Wild Rice', - 'William Pear', - 'Red Wine', - 'White Wine', - 'Yeast', - 'Yellow Papaw', - 'Yellowtail Kingfish', - 'Yoghurt', - 'Yogurt', - 'Zucchini', + 'achacha', + 'adzuki beans', + 'agar', + 'agave syrup', + 'ajowan seed', + 'albacore tuna', + 'alfalfa', + 'allspice', + 'almond oil', + 'almonds', + 'amaranth', + 'amchur', + 'anchovies', + 'aniseed', + 'annatto seed', + 'apple cider vinegar', + 'apple juice', + 'apple juice concentrate', + 'apples', + 'apricots', + 'arborio rice', + 'arrowroot', + 'artichoke', + 'arugula', + 'asafoetida', + 'asian greens', + 'asian noodles', + 'asparagus', + 'aubergine', + 'avocado', + 'avocado oil', + 'avocado spread', + 'bacon', + 'baking powder', + 'baking soda', + 'balsamic vinegar', + 'bamboo shoots', + 'banana', + 'barberry', + 'barley', + 'barramundi', + 'basil basmati rice', + 'bay leaves', + 'bean shoots', + 'bean sprouts', + 'beans', + 'beef', + 'beef stock', + 'beetroot', + 'berries', + 'besan', + 'black eyed beans', + 'blackberries', + 'blood oranges', + 'blue cheese', + 'blue eye trevalla', + 'blue swimmer crab', + 'blueberries', + 'bocconcini', + 'bok choy', + 'bonito flakes', + 'bonza', + 'borlotti beans', + 'bran', + 'brazil nut', + 'bread', + 'brie', + 'broccoli', + 'broccolini', + 'brown flour', + 'brown mushrooms', + 'brown rice', + 'brown rice vinegar', + 'brussels sprouts', + 'buckwheat', + 'buckwheat flour', + 'buckwheat noodles', + 'bulghur', + 'bush tomato', + 'butter', + 'butter beans', + 'buttermilk', + 'butternut lettuce', + 'butternut pumpkin', + 'cabbage', + 'cacao', + 'cake', + 'calamari', + 'camellia tea oil', + 'camembert', + 'camomile', + 'candle nut', + 'cannellini beans', + 'canola oil', + 'cantaloupe', + 'capers', + 'capsicum', + 'caraway seed', + 'cardamom', + 'carob carrot', + 'carrot', + 'cashews', + 'cassia bark', + 'cauliflower', + 'cavalo', + 'cayenne', + 'celery', + 'celery seed', + 'cheddar', + 'cherries', + 'chestnut', + 'chia seeds', + 'chicken', + 'chicken stock', + 'chickory', + 'chickpea', + 'chilli pepper', + 'chinese cabbage', + 'chinese five spice', + 'chives', + 'choy sum', + 'cinnamon', + 'clams', + 'cloves', + 'cocoa powder', + 'coconut', + 'coconut oil', + 'coconut water', + 'coffee', + 'common cultivated mushrooms', + 'corella pear', + 'coriander leaves', + 'coriander seed', + 'corn oil', + 'corn syrup', + 'corn tortilla', + 'cornichons', + 'cornmeal', + 'cos lettuce', + 'cottage cheese', + 'cous cous', + 'crabs', + 'cranberry', + 'cream', + 'cream cheese', + 'cucumber', + 'cumin', + 'cumquat', + 'currants', + 'curry leaves', + 'curry powder', + 'custard apples', + 'dandelion', + 'dark chocolate', + 'dashi', + 'dates', + 'dill', + 'dragonfruit', + 'dried apricots', + 'dried chinese broccoli', + 'duck', + 'edam', + 'edamame', + 'eggplant', + 'eggs', + 'elderberry', + 'endive', + 'english spinach', + 'enoki mushrooms', + 'extra virgin olive oil', + 'farmed prawns', + 'feijoa', + 'fennel', + 'fennel seeds', + 'fenugreek', + 'feta', + 'figs', + 'file powder', + 'fingerlime', + 'fish sauce', + 'fish stock', + 'flat mushrooms', + 'flathead', + 'flaxseed', + 'flaxseed oil', + 'flounder', + 'flour', + 'freekeh', + 'french eschallots', + 'fresh chillies', + 'fromage blanc', + 'fruit', + 'galangal', + 'garam masala', + 'garlic', + 'goat cheese', + 'goat milk', + 'goji berry', + 'grape seed oil', + 'grapefruit', + 'grapes', + 'green beans', + 'green pepper', + 'green tea', + 'green tea noodles', + 'greenwheat freekeh', + 'gruyere', + 'guava', + 'gula melaka', + 'haloumi', + 'ham', + 'haricot beans', + 'harissa', + 'hazelnut', + 'hijiki', + 'hiramasa kingfish', + 'hokkien noodles', + 'honey', + 'honeydew melon', + 'horseradish', + 'hot smoked salmon', + 'hummus', + 'iceberg lettuce', + 'incaberries', + 'jarrahdale pumpkin', + 'jasmine rice', + 'jelly', + 'jerusalem artichoke', + 'jewfish', + 'jicama', + 'juniper berries', + 'kale', + 'kangaroo', + 'kecap manis', + 'kenchur', + 'kidney beans', + 'kidneys', + 'kiwi berries', + 'kiwi fruit', + 'kohlrabi', + 'kokam', + 'kombu', + 'koshihikari rice', + 'kudzu', + 'kumera', + 'lamb', + 'lavender flowers', + 'leeks', + 'lemon', + 'lemongrass', + 'lentils', + 'lettuce', + 'licorice', + 'lime leaves', + 'limes', + 'liver', + 'lobster', + 'longan', + 'loquats', + 'lotus root', + 'lychees', + 'macadamia nut', + 'macadamia oil', + 'mace', + 'mackerel', + 'mahi mahi', + 'mahlab', + 'malt vinegar', + 'mandarins', + 'mango', + 'mangosteens', + 'maple syrup', + 'margarine', + 'marigold', + 'marjoram', + 'mastic', + 'melon', + 'milk', + 'milk chocolate', + 'mint', + 'miso', + 'molasses', + 'monkfish', + 'morwong', + 'mountain bread', + 'mozzarella', + 'muesli', + 'mulberries', + 'mullet', + 'mung beans', + 'mussels', + 'mustard', + 'mustard seed', + 'nashi pear', + 'nasturtium', + 'nectarines', + 'nori', + 'nutmeg', + 'nutritional yeast', + 'nuts', + 'oat flour', + 'oatmeal', + 'oats', + 'octopus', + 'okra', + 'olive oil', + 'olives', + 'omega spread', + 'onion', + 'oranges', + 'oregano', + 'oyster mushrooms', + 'oyster sauce', + 'oysters', + 'pandanus leaves', + 'papaw', + 'papaya', + 'paprik', + 'parmesan cheese', + 'parrotfish', + 'parsley', + 'parsnip', + 'passionfruit', + 'pasta', + 'peaches', + 'peanuts', + 'pear', + 'pear juice', + 'pears', + 'peas', + 'pecan nut', + 'pecorino', + 'pepitas', + 'peppercorns', + 'peppermint', + 'peppers', + 'persimmon', + 'pine nut', + 'pineapple', + 'pinto beans', + 'pistachio nut', + 'plums', + 'polenta', + 'pomegranate', + 'poppy seed', + 'porcini mushrooms', + 'pork', + 'potato flour', + 'potatoes', + 'provolone', + 'prunes', + 'pumpkin', + 'pumpkin seed', + 'purple carrot', + 'purple rice', + 'quark quinc', + 'quinoa', + 'radicchio', + 'radish', + 'raisin', + 'raspberry', + 'red cabbage', + 'red lentils', + 'red pepper', + 'red wine', + 'red wine vinegar', + 'redfish', + 'rhubarb', + 'rice flour', + 'rice noodles', + 'rice paper', + 'rice syrup', + 'ricemilk', + 'ricotta', + 'rockmelon', + 'rose water', + 'rosemary', + 'rye', + 'rye bread', + 'safflower oil', + 'saffron', + 'sage', + 'sake', + 'salmon', + 'sardines', + 'sausages', + 'scallops', + 'sea salt', + 'semolina', + 'sesame oil', + 'sesame seeds', + 'shark', + 'shiitake mushrooms', + 'silverbeet', + 'slivered almonds', + 'smoked trout', + 'snapper', + 'snowpea sprouts', + 'snowpeas', + 'soba', + 'sour dough bread', + 'soy', + 'soy beans', + 'soy flour', + 'soy milk', + 'soy sauce', + 'soymilk', + 'spearmint', + 'spelt', + 'spelt bread', + 'spinach', + 'spring onions', + 'sprouts', + 'squash', + 'squid', + 'star anise', + 'star fruit', + 'starfruit', + 'stevia', + 'strawberries', + 'sugar', + 'sultanas', + 'sun-dried tomatoes', + 'sunflower oil', + 'sunflower seeds', + 'sweet chilli sauce', + 'sweet potato', + 'swiss chard', + 'swordfish', + 'szechuan pepperberry', + 'tabasco', + 'tahini', + 'taleggio cheese', + 'tamari', + 'tamarillo', + 'tangelo', + 'tapioca', + 'tapioca flour', + 'tarragon', + 'tea', + 'tea oil', + 'tempeh', + 'thyme', + 'tinned', + 'tofu', + 'tom yum', + 'tomatoes', + 'trout', + 'tuna', + 'turkey', + 'turmeric', + 'turnips', + 'unbleached flour', + 'vanilla beans', + 'vegetable oil', + 'vegetable spaghetti', + 'vegetable stock', + 'vermicelli noodles', + 'vinegar', + 'wakame', + 'walnut', + 'warehou', + 'wasabi', + 'water', + 'watercress', + 'watermelon', + 'wattleseed', + 'wheat', + 'wheatgrass juice', + 'white bread', + 'white flour', + 'white rice', + 'white wine', + 'white wine vinegar', + 'whiting wild rice', + 'wholegrain bread', + 'wholemeal', + 'wholewheat flour', + 'william pear', + 'yeast', + 'yellow papaw', + 'yellowtail kingfish', + 'yoghurt', + 'yogurt', + 'zucchini', ]; diff --git a/src/locales/en/food/meat.ts b/src/locales/en/food/meat.ts new file mode 100644 index 00000000000..3645d1d9017 --- /dev/null +++ b/src/locales/en/food/meat.ts @@ -0,0 +1,18 @@ +export default [ + 'beef', + 'chicken', + 'crocodile', + 'duck', + 'emu', + 'goose', + 'kangaroo', + 'lamb', + 'ostrich', + 'pigeon', + 'pork', + 'quail', + 'rabbit', + 'salmon', + 'turkey', + 'venison', +]; diff --git a/src/locales/en/food/spice.ts b/src/locales/en/food/spice.ts index 0a0211e4b74..f76d8e969f2 100644 --- a/src/locales/en/food/spice.ts +++ b/src/locales/en/food/spice.ts @@ -1,132 +1,100 @@ export default [ - 'Achiote Seed', - 'Ajwain Seed', - 'Ajwan Seed', - 'Allspice', - 'Amchoor', - 'Anise', - 'Anise Star', - 'Aniseed', - 'Annatto Seed', - 'Arrowroot', - 'Asafoetida', - 'Baharat', - 'Balti Masala', - 'Balti Stir Fry Mix', - 'Basil', - 'Bay Leaves', - 'BBQ Seasoning', - 'Biryani Spice Mix', - 'Cajun Seasoning', - 'Caraway Seed', - 'Cardamom', - 'Cassia', - 'Cayenne Pepper', - 'Celery', - 'Chamomile', - 'Chervil', - 'Chicken Seasoning', - 'Chilli', - 'Chilli Pepper', - 'Chillies', - 'China Star', - 'Chinese 5 Spice', - 'Chives', - 'Cinnamon', - 'Cloves', - 'Colombo', - 'Coriander', - 'Creole Seasoning', - 'Cumin', - 'Curly Leaf Parsley', - 'Curry', - 'Dhansak Spice Mix', - 'Dill', - 'Fajita Seasoning', - 'Fennel Seed', - 'Fenugreek', - 'Fines Herbes', - 'Fish Seasoning', - 'Five Spice Mix', - 'French Lavender', - 'Galangal', - 'Garam Masala', - 'Garlic', - 'German Chamomile', - 'Ginger', - 'Green Cardamom', - 'Herbes de Provence', - 'Jalfrezi Curry', - 'Jalfrezi Mix', - 'Jerk Seasoning', - 'Juniper Berries', - 'Kaffir Leaves', - 'Korma Curry', - 'Korma Mix', - 'Lamb Seasoning', - 'Lavender', - 'Lemon Grass', - 'Lemon Pepper', - 'Lime Leaves', - 'Liquorice Root', - 'Mace', - 'Mango', - 'Marjoram', - 'Methi', - 'Methi Leaves', - 'Mexican Salsa Mix', - 'Mint', - 'Mixed Herbs', - 'Mixed Spice', - 'Mulled Cider Spices', - 'Mulled Wine Spices', - 'Mustard', - 'Nigella', - 'Nutmeg', - 'Onion Seed', - 'Orange Zest', - 'Oregano', - 'Paella Seasoning', - 'Paprika', - 'Parsley', - 'Pepper', - 'Peppercorns', - 'Pickling Spice', - 'Pimento', - 'Piri Piri Seasoning', - 'Pizza Topping Mix', - 'Poppy Seed', - 'Pot Marjoram', - 'Poudre de Colombo', - 'Ras-el-Hanout', - 'Rice Paper', - 'Rogan Josh Curry', - 'Rogan Josh Mix', - 'Rose Baie', - 'Rosemary', - 'Saffron', - 'Sage', - 'Sea Salt Coarse', - 'Seasoning Salt', - 'Self Adhesive Spice Labels', - 'Sesame Seed', - 'Spearmint', - 'Spice Charts', - 'Steak Seasoning', - 'Sumac', - 'Sweet Basil', - 'Sweet Laurel', - 'Tagine Seasoning', - 'Tandoori Masala', - 'Tandoori Mix', - 'Tarragon', - 'Thai Creen Curry Mix', - 'Thai Red Curry Mix', - 'Thai Stir Fry', - 'Thyme', - 'Tikka Masala', - 'Turmeric', - 'Vanilla', - 'Vegetable Seasoning', - 'Zahtar Spice Mix', + 'achiote seed', + 'ajwain seed', + 'ajwan seed', + 'allspice', + 'amchoor', + 'anise', + 'anise star', + 'aniseed', + 'annatto seed', + 'arrowroot', + 'asafoetida', + 'baharat', + 'balti masala', + 'balti stir fry mix', + 'basil', + 'bay leaves', + 'bbq', + 'caraway seed', + 'cardamom', + 'cassia', + 'cayenne pepper', + 'celery', + 'chamomile', + 'chervil', + 'chilli', + 'chilli pepper', + 'chillies', + 'china star', + 'chives', + 'cinnamon', + 'cloves', + 'colombo', + 'coriander', + 'cumin', + 'curly leaf parsley', + 'curry', + 'dhansak', + 'dill', + 'fennel seed', + 'fenugreek', + 'fines herbes', + 'five spice', + 'french lavender', + 'galangal', + 'garam masala', + 'garlic', + 'german chamomile', + 'ginger', + 'green cardamom', + 'herbes de provence', + 'jalfrezi', + 'jerk', + 'kaffir leaves', + 'korma', + 'lavender', + 'lemon grass', + 'lemon pepper', + 'lime leaves', + 'liquorice root', + 'mace', + 'mango', + 'marjoram', + 'methi', + 'mint', + 'mustard', + 'nutmeg', + 'onion seed', + 'orange zest', + 'oregano', + 'paprika', + 'parsley', + 'pepper', + 'peppercorns', + 'pimento', + 'piri piri', + 'poppy seed', + 'pot marjoram', + 'poudre de colombo', + 'ras-el-hanout', + 'rice paper', + 'rogan josh', + 'rose baie', + 'rosemary', + 'saffron', + 'sage', + 'sesame seed', + 'spearmint', + 'sumac', + 'sweet basil', + 'sweet laurel', + 'tagine', + 'tandoori masala', + 'tarragon', + 'thyme', + 'tikka masala', + 'turmeric', + 'vanilla', + 'zahtar', ]; diff --git a/src/locales/en/food/vegetable.ts b/src/locales/en/food/vegetable.ts index 2f52b508108..7e1019cf526 100644 --- a/src/locales/en/food/vegetable.ts +++ b/src/locales/en/food/vegetable.ts @@ -1,66 +1,66 @@ export default [ - 'Artichoke', - 'Arugula', - 'Asian Greens', - 'Asparagus', - 'Bean Shoots', - 'Bean Sprouts', - 'Beans', - 'Green beans', - 'Beetroot', - 'Bok Choy', - 'Broccoli', - 'Broccolini', - 'Brussels Sprouts', - 'Butternut lettuce', - 'Cabbage', - 'Capers', - 'Carob Carrot', - 'Carrot', - 'Cauliflower', - 'Celery', - 'Chilli Pepper', - 'Chinese Cabbage', - 'Fresh Chillies', - 'Dried Chinese Broccoli', - 'Cornichons', - 'Cos lettuce', - 'Cucumber', - 'Eggplant', - 'Endive', - 'English Spinach', - 'French eschallots', - 'Garlic', - 'Chives', - 'Green Pepper', - 'Hijiki', - 'Iceberg lettuce', - 'Jerusalem Artichoke', - 'Jicama', - 'Kale', - 'Kohlrabi', - 'Leeks', - 'Lettuce', - 'Onion', - 'Okra', - 'Parsnip', - 'Peas', - 'Peppers', - 'Potatoes', - 'Pumpkin', - 'Purple carrot', - 'Radicchio', - 'Radish', - 'Raspberry', - 'Red cabbage', - 'Red Pepper', - 'Rhubarb', - 'Snowpea sprouts', - 'Spinach', - 'Squash', - 'Sun dried tomatoes', - 'Sweet Potato', - 'Swiss Chard', - 'Turnips', - 'Zucchini', + 'artichoke', + 'arugula', + 'asian greens', + 'asparagus', + 'bean shoots', + 'bean sprouts', + 'beans', + 'beetroot', + 'bok choy', + 'broccoli', + 'broccolini', + 'brussels sprouts', + 'butternut lettuce', + 'cabbage', + 'capers', + 'carob carrot', + 'carrot', + 'cauliflower', + 'celery', + 'chilli pepper', + 'chinese cabbage', + 'chives', + 'cornichons', + 'cos lettuce', + 'cucumber', + 'dried chinese broccoli', + 'eggplant', + 'endive', + 'english spinach', + 'french eschallots', + 'fresh chillies', + 'garlic', + 'green beans', + 'green pepper', + 'hijiki', + 'iceberg lettuce', + 'jerusalem artichoke', + 'jicama', + 'kale', + 'kohlrabi', + 'leeks', + 'lettuce', + 'okra', + 'onion', + 'parsnip', + 'peas', + 'peppers', + 'potatoes', + 'pumpkin', + 'purple carrot', + 'radicchio', + 'radish', + 'raspberry', + 'red cabbage', + 'red pepper', + 'rhubarb', + 'snowpea sprouts', + 'spinach', + 'squash', + 'sun dried tomatoes', + 'sweet potato', + 'swiss chard', + 'turnips', + 'zucchini', ]; diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index daaab09a696..db1bde8b2c6 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -6,21 +6,34 @@ import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-fu * * ### Overview * - * This module provides methods to generate various food-related information, such as [dish names](https://fakerjs.dev/api/food.html#dish), [spices](https://fakerjs.dev/api/food.html#spice) or [vegetables](https://fakerjs.dev/api/food.html#vegetable). - * To generate descriptions for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). + * This module provides methods to generate various food-related information, such as items on a menu. + * To generate the name of a dish, use [dish()](https://fakerjs.dev/api/food.html#dish) and to generate a long description for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). Note that these will not correspond with each other. + * You can also generate individual components of a dish such as [spices](https://fakerjs.dev/api/food.html#spice), [vegetables](https://fakerjs.dev/api/food.html#vegetable), [meats](https://fakerjs.dev/api/food.html#meat), [fruits](https://fakerjs.dev/api/food.html#fruit), or generic [ingredients](https://fakerjs.dev/api/food.html#ingredient). */ export class FoodModule { constructor(private readonly faker: Faker) { bindThisToMemberFunctions(this); } + /** + * Generates a random dish adjective. + * + * @example + * faker.food.adjective() // 'crispy' + * + * @since 9.0.0 + */ + adjective(): string { + return this.faker.helpers.fake(this.faker.definitions.food.adjective); + } + /** * Generates a random dish description. * * @example - * faker.food.description() // 'Three Coconut Water with Pumpkin, Turnips, Peppers, Raspberry and Coffee. With a side of baked Apricots, and your choice of Pineapple or Kidney Beans' + * faker.food.description() // ''An exquisite ostrich roast, infused with the essence of longan, slow-roasted to bring out its natural flavors and served with a side of creamy red cabbage' * - * @since 8.3.0 + * @since 9.0.0 */ description(): string { return this.faker.helpers.fake( @@ -32,12 +45,22 @@ export class FoodModule { * Generates a random dish name. * * @example - * faker.food.dish() // 'Lasagne' + * faker.food.dish() // 'Tagine-Rubbed Venison Salad' * - * @since 8.3.0 + * @since 9.0.0 */ dish(): string { - return this.faker.helpers.arrayElement(this.faker.definitions.food.dish); + // A 50/50 mix of specific dishes and dish_patterns + const toTitleCase = (d: string) => + d.toLowerCase().replace(/\b\w/g, (s) => s.toUpperCase()); + if (this.faker.datatype.boolean()) { + return toTitleCase( + this.faker.helpers.fake(this.faker.definitions.food.dish_pattern) + ); + } + return toTitleCase( + this.faker.helpers.arrayElement(this.faker.definitions.food.dish) + ); } /** @@ -46,7 +69,7 @@ export class FoodModule { * @example * faker.food.ethnicCategory() // 'Italian' * - * @since 8.3.0 + * @since 9.0.0 */ ethnicCategory(): string { return this.faker.helpers.arrayElement( @@ -58,9 +81,9 @@ export class FoodModule { * Generates a random fruit name. * * @example - * faker.food.fruit() // 'Lemon' + * faker.food.fruit() // 'lemon' * - * @since 8.3.0 + * @since 9.0.0 */ fruit(): string { return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit); @@ -70,9 +93,9 @@ export class FoodModule { * Generates a random ingredient name. * * @example - * faker.food.ingredient() // 'Butter' + * faker.food.ingredient() // 'butter' * - * @since 8.3.0 + * @since 9.0.0 */ ingredient(): string { return this.faker.helpers.arrayElement( @@ -80,25 +103,37 @@ export class FoodModule { ); } + /** + * Generates a random meat + * + * @example + * faker.food.meat() // 'venison' + * + * @since 9.0.0 + */ + meat(): string { + return this.faker.helpers.arrayElement(this.faker.definitions.food.meat); + } + /** * Generates a random spice name. * * @example - * faker.food.spice() // 'Chilli' + * faker.food.spice() // 'chilli' * - * @since 8.3.0 + * @since 9.0.0 */ spice(): string { return this.faker.helpers.arrayElement(this.faker.definitions.food.spice); } /** - * Generates a random spice name. + * Generates a random vegetable name. * * @example - * faker.food.vegetable() // 'Broccoli' + * faker.food.vegetable() // 'broccoli' * - * @since 8.3.0 + * @since 9.0.0 */ vegetable(): string { return this.faker.helpers.arrayElement( From c21cf81d670a1d3c4640c52a16e520c5a11300e5 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Fri, 19 Jan 2024 20:35:35 +0700 Subject: [PATCH 08/16] fix lint --- src/modules/food/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index db1bde8b2c6..a0713575292 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -58,6 +58,7 @@ export class FoodModule { this.faker.helpers.fake(this.faker.definitions.food.dish_pattern) ); } + return toTitleCase( this.faker.helpers.arrayElement(this.faker.definitions.food.dish) ); From f5515d475fa2b33d3a9837bd8f68631a7873ddf3 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Fri, 19 Jan 2024 20:49:25 +0700 Subject: [PATCH 09/16] fix tests --- test/modules/__snapshots__/food.spec.ts.snap | 50 ++++++++++++-------- test/modules/food.spec.ts | 26 ++++++++-- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/test/modules/__snapshots__/food.spec.ts.snap b/test/modules/__snapshots__/food.spec.ts.snap index d5953b8d50d..41a7515e398 100644 --- a/test/modules/__snapshots__/food.spec.ts.snap +++ b/test/modules/__snapshots__/food.spec.ts.snap @@ -1,43 +1,55 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`food > 42 > description 1`] = `"A slow-roasted Bachman's Warbler with a crisp, golden exterior. Stuffed with Sultanas and covered in Cavalo sauce. Sides with Peppers puree and wild Purple carrot."`; +exports[`food > 42 > adjective 1`] = `"golden"`; -exports[`food > 42 > dish 1`] = `"Katsu Curry"`; +exports[`food > 42 > description 1`] = `"A succulent venison steak, encased in a sour liquorice root crust, served with a side of bay leaves mashed broccoli."`; + +exports[`food > 42 > dish 1`] = `"Caraway Seed-Crusted Rabbit"`; exports[`food > 42 > ethnicCategory 1`] = `"Gujarati"`; -exports[`food > 42 > fruit 1`] = `"Feijoa"`; +exports[`food > 42 > fruit 1`] = `"fig"`; + +exports[`food > 42 > ingredient 1`] = `"flat mushrooms"`; + +exports[`food > 42 > meat 1`] = `"goose"`; -exports[`food > 42 > ingredient 1`] = `"Fish Sauce"`; +exports[`food > 42 > spice 1`] = `"dhansak"`; -exports[`food > 42 > spice 1`] = `"Five Spice Mix"`; +exports[`food > 42 > vegetable 1`] = `"cos lettuce"`; -exports[`food > 42 > vegetable 1`] = `"Dried Chinese Broccoli"`; +exports[`food > 1211 > adjective 1`] = `"tender"`; -exports[`food > 1211 > description 1`] = `"A special turquoise Sunflower Seeds from San Marino. To support the strong flavor it is sided with a tablespoon of Chillies."`; +exports[`food > 1211 > description 1`] = `"tamari with a pinch of chamomile, topped by a caramelized watermelon with whipped cream"`; -exports[`food > 1211 > dish 1`] = `"Teriyaki Chicken Donburi"`; +exports[`food > 1211 > dish 1`] = `"Lasagne"`; -exports[`food > 1211 > ethnicCategory 1`] = `"Thai"`; +exports[`food > 1211 > ethnicCategory 1`] = `"Texan"`; -exports[`food > 1211 > fruit 1`] = `"Strawberries"`; +exports[`food > 1211 > fruit 1`] = `"strawberry"`; -exports[`food > 1211 > ingredient 1`] = `"Tofu"`; +exports[`food > 1211 > ingredient 1`] = `"turmeric"`; -exports[`food > 1211 > spice 1`] = `"Tarragon"`; +exports[`food > 1211 > meat 1`] = `"turkey"`; -exports[`food > 1211 > vegetable 1`] = `"Sun dried tomatoes"`; +exports[`food > 1211 > spice 1`] = `"tagine"`; -exports[`food > 1337 > description 1`] = `"Macadamia Oil with a pinch of Cardamom, topped by a caramelized Cherries with whipped cream"`; +exports[`food > 1211 > vegetable 1`] = `"sun dried tomatoes"`; -exports[`food > 1337 > dish 1`] = `"Ebiten maki"`; +exports[`food > 1337 > adjective 1`] = `"fluffy"`; + +exports[`food > 1337 > description 1`] = `"A slow-roasted White-winged Scoter with a fluffy, moist exterior. Stuffed with dried apricot and covered in kiwi fruit sauce. Sides with carrot puree and wild turnips."`; + +exports[`food > 1337 > dish 1`] = `"Cauliflower-Infused Ostrich"`; exports[`food > 1337 > ethnicCategory 1`] = `"Czech"`; -exports[`food > 1337 > fruit 1`] = `"Currants"`; +exports[`food > 1337 > fruit 1`] = `"custard apple"`; + +exports[`food > 1337 > ingredient 1`] = `"coconut water"`; -exports[`food > 1337 > ingredient 1`] = `"Cinnamon"`; +exports[`food > 1337 > meat 1`] = `"emu"`; -exports[`food > 1337 > spice 1`] = `"Cloves"`; +exports[`food > 1337 > spice 1`] = `"chilli pepper"`; -exports[`food > 1337 > vegetable 1`] = `"Carob Carrot"`; +exports[`food > 1337 > vegetable 1`] = `"carrot"`; diff --git a/test/modules/food.spec.ts b/test/modules/food.spec.ts index e6250f62357..473a191b1c5 100644 --- a/test/modules/food.spec.ts +++ b/test/modules/food.spec.ts @@ -1,12 +1,14 @@ import { describe, expect, it } from 'vitest'; import { faker } from '../../src'; -import { seededTests } from '../support/seededRuns'; -import { times } from '../support/times'; +import { seededTests } from '../support/seeded-runs'; +import { times } from './../support/times'; const NON_SEEDED_BASED_RUN = 5; describe('food', () => { seededTests(faker, 'food', (t) => { + t.it('adjective'); + t.it('description'); t.it('dish'); @@ -17,6 +19,8 @@ describe('food', () => { t.it('ingredient'); + t.it('meat'); + t.it('spice'); t.it('vegetable'); @@ -25,10 +29,17 @@ describe('food', () => { describe.each(times(NON_SEEDED_BASED_RUN).map(() => faker.seed()))( 'random seeded tests for seed %i', () => { + describe('adjective', () => { + it(`should return random value from adjective array`, () => { + const actual = faker.food.adjective(); + expect(faker.definitions.food.adjective).toContain(actual); + }); + }); + describe('dish', () => { - it(`should return random value from dish array`, () => { + it(`should be a capitalized string`, () => { const actual = faker.food.dish(); - expect(faker.definitions.food.dish).toContain(actual); + expect(actual[0]).toBe(actual[0].toUpperCase()); }); }); @@ -53,6 +64,13 @@ describe('food', () => { }); }); + describe('meat', () => { + it(`should return random value from meat array`, () => { + const actual = faker.food.meat(); + expect(faker.definitions.food.meat).toContain(actual); + }); + }); + describe('spice', () => { it(`should return random value from spice array`, () => { const actual = faker.food.spice(); From be599a5f8ef802a04d7aa97959516e1de056edc1 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Fri, 19 Jan 2024 20:53:16 +0700 Subject: [PATCH 10/16] tweak descriptions --- src/locales/en/food/description_pattern.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/en/food/description_pattern.ts b/src/locales/en/food/description_pattern.ts index 848a0c7211a..21909d0b4ac 100644 --- a/src/locales/en/food/description_pattern.ts +++ b/src/locales/en/food/description_pattern.ts @@ -11,6 +11,7 @@ export default [ 'Baked {{food.ingredient}}-stuffed {{food.meat}}, seasoned with {{food.spice}} and {{food.adjective}} herbs, accompanied by roasted {{food.vegetable}} medley.', 'Crispy fried {{food.meat}} bites, seasoned with {{food.spice}} and served with a tangy {{food.fruit}} dipping sauce.', 'Fresh mixed greens tossed with {{food.spice}}-rubbed {{food.meat}}, {{food.vegetable}}, and a light dressing.', + 'Fresh {{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream', 'Grilled {{food.meat}} kebabs, marinated in {{food.ethnic_category}} spices and served with a fresh {{food.vegetable}} and {{food.fruit}} salad.', 'Hearty {{food.ingredient}} and {{food.meat}} stew, slow-cooked with {{food.spice}} and {{food.vegetable}} for a comforting, flavorful meal.', 'Juicy {{food.meat}}, grilled to your liking and drizzled with a bold {{food.spice}} sauce, served alongside roasted {{food.vegetable}}.', @@ -18,6 +19,5 @@ export default [ 'Tender {{food.meat}} skewers, glazed with a sweet and tangy {{food.fruit}} sauce, served over a bed of fragrant jasmine rice.', 'Tenderly braised {{food.meat}} in a rich {{food.spice}} and {{food.vegetable}} sauce, served with a side of creamy {{food.vegetable}}.', 'Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.', - '{{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream', - '{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":1, "max":3})}} sides.', + '{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":2, "max":4})}} sides.', ]; From 368d9ceb5c6744590611ed06e458dfc3deb5d9c3 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Fri, 19 Jan 2024 20:58:44 +0700 Subject: [PATCH 11/16] fix snapshot --- test/modules/__snapshots__/food.spec.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/modules/__snapshots__/food.spec.ts.snap b/test/modules/__snapshots__/food.spec.ts.snap index 41a7515e398..84df724c0d0 100644 --- a/test/modules/__snapshots__/food.spec.ts.snap +++ b/test/modules/__snapshots__/food.spec.ts.snap @@ -20,7 +20,7 @@ exports[`food > 42 > vegetable 1`] = `"cos lettuce"`; exports[`food > 1211 > adjective 1`] = `"tender"`; -exports[`food > 1211 > description 1`] = `"tamari with a pinch of chamomile, topped by a caramelized watermelon with whipped cream"`; +exports[`food > 1211 > description 1`] = `"Three tamari with capers, zucchini, onion, onion and rice paper. With a side of baked feijoa, and your choice of persimmon or slivered almonds."`; exports[`food > 1211 > dish 1`] = `"Lasagne"`; From ee30d87227b0d3129be6e1999454de45611a900a Mon Sep 17 00:00:00 2001 From: Matt Mayer <152770+matthewmayer@users.noreply.github.com> Date: Sat, 20 Jan 2024 08:13:01 +0700 Subject: [PATCH 12/16] Update index.ts Co-authored-by: ST-DDT --- src/modules/food/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index a0713575292..2a893334d4f 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -10,10 +10,7 @@ import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-fu * To generate the name of a dish, use [dish()](https://fakerjs.dev/api/food.html#dish) and to generate a long description for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). Note that these will not correspond with each other. * You can also generate individual components of a dish such as [spices](https://fakerjs.dev/api/food.html#spice), [vegetables](https://fakerjs.dev/api/food.html#vegetable), [meats](https://fakerjs.dev/api/food.html#meat), [fruits](https://fakerjs.dev/api/food.html#fruit), or generic [ingredients](https://fakerjs.dev/api/food.html#ingredient). */ -export class FoodModule { - constructor(private readonly faker: Faker) { - bindThisToMemberFunctions(this); - } +export class FoodModule extends ModuleBase { /** * Generates a random dish adjective. From c78f0d5ee2f1363e7f5a13a09ba8ac5faff41021 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Sat, 20 Jan 2024 08:18:31 +0700 Subject: [PATCH 13/16] fix imports --- src/modules/food/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index 2a893334d4f..196cd967a05 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -1,6 +1,4 @@ -import type { Faker } from '../../faker'; -import { bindThisToMemberFunctions } from '../../internal/bind-this-to-member-functions'; - +import { ModuleBase } from '../../internal/module-base'; /** * Module for generating food-related data. * From a3da8ce079766eda7509b7a77c242848ead5d680 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Sat, 20 Jan 2024 08:51:06 +0700 Subject: [PATCH 14/16] fix lint, tweak title case --- src/modules/food/index.ts | 8 +++++--- test/modules/__snapshots__/food.spec.ts.snap | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index 196cd967a05..33f161c7ad1 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -9,7 +9,6 @@ import { ModuleBase } from '../../internal/module-base'; * You can also generate individual components of a dish such as [spices](https://fakerjs.dev/api/food.html#spice), [vegetables](https://fakerjs.dev/api/food.html#vegetable), [meats](https://fakerjs.dev/api/food.html#meat), [fruits](https://fakerjs.dev/api/food.html#fruit), or generic [ingredients](https://fakerjs.dev/api/food.html#ingredient). */ export class FoodModule extends ModuleBase { - /** * Generates a random dish adjective. * @@ -46,8 +45,11 @@ export class FoodModule extends ModuleBase { */ dish(): string { // A 50/50 mix of specific dishes and dish_patterns - const toTitleCase = (d: string) => - d.toLowerCase().replace(/\b\w/g, (s) => s.toUpperCase()); + const toTitleCase = (s: string) => + s + .split(' ') + .map((w) => w.charAt(0).toUpperCase() + w.slice(1)) + .join(' '); if (this.faker.datatype.boolean()) { return toTitleCase( this.faker.helpers.fake(this.faker.definitions.food.dish_pattern) diff --git a/test/modules/__snapshots__/food.spec.ts.snap b/test/modules/__snapshots__/food.spec.ts.snap index 84df724c0d0..5c3b894e44a 100644 --- a/test/modules/__snapshots__/food.spec.ts.snap +++ b/test/modules/__snapshots__/food.spec.ts.snap @@ -4,7 +4,7 @@ exports[`food > 42 > adjective 1`] = `"golden"`; exports[`food > 42 > description 1`] = `"A succulent venison steak, encased in a sour liquorice root crust, served with a side of bay leaves mashed broccoli."`; -exports[`food > 42 > dish 1`] = `"Caraway Seed-Crusted Rabbit"`; +exports[`food > 42 > dish 1`] = `"Caraway Seed-crusted Rabbit"`; exports[`food > 42 > ethnicCategory 1`] = `"Gujarati"`; @@ -40,7 +40,7 @@ exports[`food > 1337 > adjective 1`] = `"fluffy"`; exports[`food > 1337 > description 1`] = `"A slow-roasted White-winged Scoter with a fluffy, moist exterior. Stuffed with dried apricot and covered in kiwi fruit sauce. Sides with carrot puree and wild turnips."`; -exports[`food > 1337 > dish 1`] = `"Cauliflower-Infused Ostrich"`; +exports[`food > 1337 > dish 1`] = `"Cauliflower-infused Ostrich"`; exports[`food > 1337 > ethnicCategory 1`] = `"Czech"`; From e7e8f0576edc9470887087d220139b05d921847d Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Sat, 20 Jan 2024 09:35:23 +0700 Subject: [PATCH 15/16] MD tweak --- src/modules/food/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index 33f161c7ad1..f43398eed65 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -5,7 +5,7 @@ import { ModuleBase } from '../../internal/module-base'; * ### Overview * * This module provides methods to generate various food-related information, such as items on a menu. - * To generate the name of a dish, use [dish()](https://fakerjs.dev/api/food.html#dish) and to generate a long description for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). Note that these will not correspond with each other. + * To generate the name of a dish, use [`dish()`](https://fakerjs.dev/api/food.html#dish) and to generate a long description for a dish use [`description()`](https://fakerjs.dev/api/food.html#description). Note that these will not correspond with each other. * You can also generate individual components of a dish such as [spices](https://fakerjs.dev/api/food.html#spice), [vegetables](https://fakerjs.dev/api/food.html#vegetable), [meats](https://fakerjs.dev/api/food.html#meat), [fruits](https://fakerjs.dev/api/food.html#fruit), or generic [ingredients](https://fakerjs.dev/api/food.html#ingredient). */ export class FoodModule extends ModuleBase { From 8389722083caff89e917c2986e8e8db7aaf78fdc Mon Sep 17 00:00:00 2001 From: Matt Mayer <152770+matthewmayer@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:31:10 +0700 Subject: [PATCH 16/16] Update index.ts Co-authored-by: ST-DDT --- src/modules/food/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/food/index.ts b/src/modules/food/index.ts index f43398eed65..0effaae6bcb 100644 --- a/src/modules/food/index.ts +++ b/src/modules/food/index.ts @@ -25,7 +25,7 @@ export class FoodModule extends ModuleBase { * Generates a random dish description. * * @example - * faker.food.description() // ''An exquisite ostrich roast, infused with the essence of longan, slow-roasted to bring out its natural flavors and served with a side of creamy red cabbage' + * faker.food.description() // 'An exquisite ostrich roast, infused with the essence of longan, slow-roasted to bring out its natural flavors and served with a side of creamy red cabbage' * * @since 9.0.0 */