From 8fece5fd7f2bc4942c94c672e5d076ded211d283 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 25 Jul 2026 01:17:18 +0700 Subject: [PATCH] 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. --- renderer/scripts/render-local-args.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/renderer/scripts/render-local-args.js b/renderer/scripts/render-local-args.js index 321b36d..69a0170 100644 --- a/renderer/scripts/render-local-args.js +++ b/renderer/scripts/render-local-args.js @@ -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, }; };