Last change
on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
406 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | const spinners = Object.assign({}, require('./spinners.json')); // eslint-disable-line import/extensions
|
---|
4 |
|
---|
5 | const spinnersList = Object.keys(spinners);
|
---|
6 |
|
---|
7 | Object.defineProperty(spinners, 'random', {
|
---|
8 | get() {
|
---|
9 | const randomIndex = Math.floor(Math.random() * spinnersList.length);
|
---|
10 | const spinnerName = spinnersList[randomIndex];
|
---|
11 | return spinners[spinnerName];
|
---|
12 | }
|
---|
13 | });
|
---|
14 |
|
---|
15 | module.exports = spinners;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.