forked from sindresorhus/yes-no-words
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
28 lines (23 loc) · 757 Bytes
/
index.js
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
27
28
'use strict';
const uniqueRandomArray = require('unique-random-array');
const yes = require('./yes.json');
const no = require('./no.json');
const all = yes.concat(no).sort();
exports.yes = yes;
exports.no = no;
exports.all = all;
exports.yesRandom = function () {
return uniqueRandomArray(yes).call().split(',')[1];
};
exports.yesRandomWithLang = function () {
return uniqueRandomArray(yes).call().split(',').reverse().join(' - that\'s in ');
};
exports.noRandom = function () {
return uniqueRandomArray(no).call().split(',')[1];
};
exports.noRandomWithLang = function () {
return uniqueRandomArray(no).call().split(',').reverse().join(' - that\'s in ');
};
exports.allRandom = function () {
return uniqueRandomArray(all).call().split(',')[1];
};