blob: 77c62e3ead46cec50f1b94f3b20b3f6a169925f7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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])
|