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:
tiennm99 committed 2026-07-25 01:17:18 +07:00
1 parent ccb91adef4
commit 8fece5fd7f
1 file changed
+2 -2
+2 -2
View File
@@ -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,
};
};