-
Notifications
You must be signed in to change notification settings - Fork 0
/
pick.js
50 lines (42 loc) · 1023 Bytes
/
pick.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const humanizeString = require("humanize-string");
const { prompt } = require("enquirer");
exports.city = async cities => {
const citiesQuestions = {
type: "autocomplete",
name: "city",
message: "Selecciona una ciudad",
limit: 10,
choices: cities,
format: value => humanizeString(value)
};
return prompt(citiesQuestions);
};
exports.cinema = async cinemas => {
const cinemasQuestions = {
type: "select",
name: "cinema",
message: "Selecciona un cine",
choices: cinemas,
format: value => humanizeString(value)
};
return prompt(cinemasQuestions);
};
exports.date = async dates => {
const datesQuestions = {
type: "select",
name: "date",
message: "Seleccciona un día",
choices: dates
};
return prompt(datesQuestions);
}
exports.movie = async movies => {
const moviesQuestions = {
type: "select",
name: "movie",
message: "Seleccciona un película",
pageSize: 20,
choices: movies
};
return prompt(moviesQuestions);
}