Compare commits
No commits in common. "d3d921b3c89e2e327dc0334edcf82d972db8ea5e" and "e7620ccd425d66cce69e098ac3b8023d6db4a3e7" have entirely different histories.
d3d921b3c8
...
e7620ccd42
3 changed files with 6 additions and 7 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
@ -1,4 +1,3 @@
|
||||||
node_modules/
|
node_modules
|
||||||
dist/
|
dist
|
||||||
coverage/
|
yarn-error.log
|
||||||
yarn-error.log
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "random-bunny",
|
"name": "random-bunny",
|
||||||
"version": "2.1.2",
|
"version": "2.1.1",
|
||||||
"description": "Get a random subreddit image url",
|
"description": "Get a random subreddit image url",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Vylpes",
|
"author": "Vylpes",
|
||||||
|
|
|
@ -41,8 +41,8 @@ export default async function randomBunny(subreddit: string, sortBy?: string): P
|
||||||
return {
|
return {
|
||||||
IsSuccess: false,
|
IsSuccess: false,
|
||||||
};
|
};
|
||||||
} else {
|
} else if (dataWithImages.length > 1) {
|
||||||
random = Math.floor((Math.random() * (dataWithImages.length - 1)) + 0); // Between 0 and (size - 1)
|
random = Math.floor((Math.random() * dataWithImages.length - 1) + 0); // Between 0 and (size - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const randomSelect = dataWithImages[random];
|
const randomSelect = dataWithImages[random];
|
||||||
|
|
Loading…
Reference in a new issue