Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Fix bug in OneOf helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume committed Apr 8, 2021
1 parent b9face6 commit 5e176a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mockoon/commons-server",
"description": "Mockoon's commons server library. Used in Mockoon desktop application and CLI.",
"version": "1.0.1",
"version": "1.0.2",
"author": {
"name": "Guillaume Monnet",
"email": "hi@255kb.dev",
Expand Down
2 changes: 1 addition & 1 deletion src/libs/templating-helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Helpers = {
},
// return one random item
oneOf: function (itemList: string[]) {
return itemList[RandomInt(0, itemList.length)];
return itemList[RandomInt(0, itemList.length - 1)];
},
// return some random item as an array (to be used in triple braces) or as a string
someOf: function (
Expand Down

0 comments on commit 5e176a3

Please sign in to comment.