As you're smart, you asked every guest of the party to precise in their answer
As you're smart, you asked every guest of the party to precise in their answer
the kind of drink they would enjoy and the kind of food they would die for.
the kind of drink they would enjoy and the kind of food they would die for.
Create a `happiness-manager.mjs` script that sort, who wants to drink what and
Create a `happiness-manager.mjs` script that sorts, who wants to drink what and
who wants to eat what and integrate that in your barbecue's shopping list!
who wants to eat what and integrate that in your barbecue's shopping list!
> note that you must only consider **vips** guests, those that answerd `'yes'`
> note that you must only consider as **VIP** guests, those that answered `'yes'`
The script must:
The script must:
- Take a directory as first argument (the `guest` directory)
- Take a directory as first argument (the `guest` directory)
- Take a file `.json` as second argument:
- Take a file `.json` as second argument:
- If the file already exists, it will add the informations to it. If some elements already exist in the original file, it will be replaced by new values.
- If the file already exists, it will add the information to it. If some elements already exist in the original file, it will be replaced by new values.
- If it doesn't, the script must handle the creation of the file.
- If it doesn't, the script must handle the creation of the file.
- Handle case when no one answered yes to the invitation:
- Handle the case when no one answered yes to the invitation:
- `No one is coming.` has to appear in console.
- `No one is coming.` has to appear in the console.
- No file is updated/created.
- No file is updated/created.
- Handle cases when answers contains no "food" information, or no "drink"
- Handle cases when answers contain no "food" information, or no "drink"
information
information
- Handle cases when no one has chosen a category (for example: no one chose to
- Handle cases when no one has chosen a category (for example: no one chose to
drink softs). This category should not appear in the final list.
drink softs). This category should not appear in the final list.