dh_demo

DreamHanks demo project
git clone git://git.lair.cx/dh_demo
Log | Files | Refs | README

random_name.ts (1469B)


      1 const adjectives = [
      2   'acoustic',
      3   'unhappy',
      4   'three',
      5   'nappy',
      6   'unequaled',
      7   'mighty',
      8   'adventurous',
      9   'loving',
     10   'terrible',
     11   'stupid',
     12   'workable',
     13   'tedious',
     14   'annoyed',
     15   'scary',
     16   'nimble',
     17   'nondescript',
     18   'plain',
     19   'square',
     20   'unlikely',
     21   'basic',
     22   'wry',
     23   'busy',
     24   'military',
     25   'greedy',
     26   'condemned',
     27   'aspiring',
     28   'groovy',
     29   'hypnotic',
     30   'colorful',
     31   'bitter',
     32   'normal',
     33   'dizzy',
     34   'low',
     35   'rapid',
     36   'uttermost',
     37   'faded',
     38   'shut',
     39   'mixed',
     40   'desperate',
     41   'living',
     42   'suitable',
     43   'crooked',
     44   'round',
     45   'husky',
     46   'lazy',
     47   'tidy',
     48   'aromatic',
     49   'sufficient',
     50   'illustrious',
     51   'garrulous',
     52 ]
     53 
     54 const nouns = [
     55   'mood',
     56   'writing',
     57   'potato',
     58   'player',
     59   'safety',
     60   'context',
     61   'tennis',
     62   'menu',
     63   'guest',
     64   'thanks',
     65   'flight',
     66   'coffee',
     67   'bonus',
     68   'oven',
     69   'skill',
     70   'food',
     71   'version',
     72   'woman',
     73   'memory',
     74   'salad',
     75   'cell',
     76   'phone',
     77   'soup',
     78   'poem',
     79   'library',
     80   'surgery',
     81   'winner',
     82   'singer',
     83   'meaning',
     84   'office',
     85   'science',
     86   'dad',
     87   'story',
     88   'finding',
     89   'affair',
     90   'way',
     91   'dinner',
     92   'moment',
     93   'dealer',
     94   'physics',
     95   'insect',
     96   'disk',
     97   'speaker',
     98   'pie',
     99   'session',
    100   'bedroom',
    101   'exam',
    102   'month',
    103   'church',
    104   'article',
    105 ]
    106 
    107 export function generateRandomName () {
    108   const adjective = adjectives[Math.floor(Math.random() * adjectives.length)]
    109   const noun = nouns[Math.floor(Math.random() * nouns.length)]
    110   return `${adjective}-${noun}`
    111 }