TootComposer: fix random stmt may be empty
This commit is contained in:
parent
591a930bb6
commit
a6b791ab5a
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/package",
|
"$schema": "https://json.schemastore.org/package",
|
||||||
"name": "tutu",
|
"name": "tutu",
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
@ -183,7 +183,7 @@ function randomChoose<T extends any[]>(
|
||||||
rn: number,
|
rn: number,
|
||||||
K: T,
|
K: T,
|
||||||
): T extends Array<infer E> ? E : never {
|
): T extends Array<infer E> ? E : never {
|
||||||
const idx = Math.round(rn * K.length);
|
const idx = Math.round(rn * K.length) - 1;
|
||||||
return K[idx];
|
return K[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue