mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 03:13:46 +00:00
refactor(cli): reuse pickWinnerIndex for local winner selection
Route the CLI through the shared winner picker instead of crypto.randomInt so the positive-integer guard and selection intent stay consistent with the API.
This commit is contained in:
1 parent
ccb91adef4
commit
8fece5fd7f
1 file changed
+2
-2
@@ -1,5 +1,5 @@
|
||||
import {randomInt} from 'node:crypto';
|
||||
import {parseArgs} from 'node:util';
|
||||
import {pickWinnerIndex} from '../src/lib/winner.js';
|
||||
import {parseWheelRequest} from '../src/schemas/wheel-request.js';
|
||||
|
||||
const limits = {
|
||||
@@ -87,7 +87,7 @@ export const parseRenderLocalArgs = (args) => {
|
||||
return {
|
||||
help: false,
|
||||
output: values.output,
|
||||
request: parseWheelRequest(input, limits, randomInt),
|
||||
request: parseWheelRequest(input, limits, pickWinnerIndex),
|
||||
timeoutInMilliseconds,
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user