diff options
Diffstat (limited to 'node_modules/at-quotes/src/index.js')
| -rw-r--r-- | node_modules/at-quotes/src/index.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/at-quotes/src/index.js b/node_modules/at-quotes/src/index.js new file mode 100644 index 0000000..77c62e3 --- /dev/null +++ b/node_modules/at-quotes/src/index.js @@ -0,0 +1,26 @@ +import textr from 'textr' +import ellipses from 'typographic-ellipses' +import spaces from 'typographic-single-spaces' +import quotes from 'typographic-quotes' + +import Finn from './lib/finn' +import Jake from './lib/jake' +import IceKing from './lib/ice-king' + +const transform = textr() + .use(ellipses) + .use(spaces) + .use(quotes) + .use(String.prototype.trim) + +const getRandomQuote = (arr) => { + const randomSeason = arr[Math.floor(Math.random() * arr.length)] + const randomQuote = randomSeason[Math.floor(Math.random() * randomSeason.length)] + + return transform(randomQuote) +} + +export const getIceKingQuote = () => getRandomQuote(IceKing) +export const getFinnQuote = () => getRandomQuote(Finn) +export const getJakeQuote = () => getRandomQuote(Jake) +export const getQuote = () => getRandomQuote([...Jake, ...Finn, ...IceKing]) |