diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-04-04 01:02:37 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-04-04 01:02:37 +0200 |
| commit | f331d8dc9568d3db8dcaa9958250f6e6664548d3 (patch) | |
| tree | 5c291f08730678101ccb77945bf1a546b938d007 /rules/business.js | |
| parent | 920e58a2d57f7999d55c43829ffcd28cfe6b6952 (diff) | |
Move rules to lib
Diffstat (limited to 'rules/business.js')
| -rw-r--r-- | rules/business.js | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/rules/business.js b/rules/business.js deleted file mode 100644 index bc12866..0000000 --- a/rules/business.js +++ /dev/null @@ -1,74 +0,0 @@ -const internals ={ - - businesses: [ - 'butcher shops', - 'plant shops', - 'balloon factories', - 'pet hotels', - 'sex shops', - 'clothes incineration facilities', - 'city dumps', - 'glass factories', - 'roads', - 'windfarm analysis consultancies', - 'peanut depots', - 'glue factories', - 'bürgeramts', - 'chiropractors', - 'gong bath facilities', - 'wrestling rings', - 'cat cafés', - 'paint your own pottery centers', - 'dungeons', - 'television sets', - 'nasa offices', - 'toilet factories', - 'condom inspection facilities', - 'high school newspapers', - 'dog spas', - 'mink breeding centers', - 'ngos', - 'yoga cults', - 'mi6 safehouses', - 'döner shops', - 'hospitals' - ], - - restrictions: [ - 'are required to work from home', - 'require mandatory testing', - 'must remain closed', - 'must remain open', - 'must offer 50% covid discounts', - 'must become vaccination centers', - 'must pay staff 3x on thursdays', - 'can only meet with one other household', - 'must share facilities', - 'are exempt from mask rules', - ], - - join(array) { - - const firstPart = array.slice(0, -1).join(', ') - const lastPart = array.slice(-1) - - const conjunction = array.length <= 1 ? '' : ', and ' - - return [firstPart, lastPart].join(conjunction) - } -}; - -module.exports = () => { - - const businesses = internals.businesses - .filter(() => true) - .sort(() => Math.random() - 0.5) - .slice(0, Math.floor(Math.random() * 3) + 1) - const restriction = internals.restrictions[Math.floor(Math.random() * internals.restrictions.length)]; - const text = `${internals.join(businesses)} ${restriction}` - - return { - emoji: '🏢', - text: text.charAt(0).toUpperCase() + text.slice(1) - }; -} |