Compare commits
5 commits
1bf6046037
...
90515ddae5
Author | SHA1 | Date | |
---|---|---|---|
90515ddae5 | |||
f67e001cf0 | |||
8e268a0cc3 | |||
d3d921b3c8 | |||
e766a42235 |
4 changed files with 1041 additions and 537 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
node_modules
|
||||
dist
|
||||
node_modules/
|
||||
dist/
|
||||
coverage/
|
||||
yarn-error.log
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "random-bunny",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.3",
|
||||
"description": "Get a random subreddit image url",
|
||||
"license": "MIT",
|
||||
"author": "Vylpes",
|
||||
|
@ -42,14 +42,15 @@
|
|||
"eslint": "^8.35.0",
|
||||
"jest": "^29.4.3",
|
||||
"jest-mock-extended": "^3.0.3",
|
||||
"np": "^7.7.0",
|
||||
"np": "^8.0.0",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-mockito": "^2.6.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"np/**/got": "^11.8.5"
|
||||
"np/**/got": "^11.8.5",
|
||||
"**/semver": "^7.5.2"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
|
|
@ -41,8 +41,8 @@ export default async function randomBunny(subreddit: string, sortBy?: string): P
|
|||
return {
|
||||
IsSuccess: false,
|
||||
};
|
||||
} else if (dataWithImages.length > 1) {
|
||||
random = Math.floor((Math.random() * dataWithImages.length - 1) + 0); // Between 0 and (size - 1)
|
||||
} else {
|
||||
random = Math.floor((Math.random() * (dataWithImages.length - 1)) + 0); // Between 0 and (size - 1)
|
||||
}
|
||||
|
||||
const randomSelect = dataWithImages[random];
|
||||
|
|
Loading…
Reference in a new issue