+2
-1
src/sequencer.ts
+2
-1
src/sequencer.ts
···
2
import { voiceLines } from './voice.js';
3
import type { Config } from './index.js';
4
import type { Voice } from './voice.js';
5
6
type SegmentName = string;
7
type SequenceName = string;
···
16
let config: Config = null;
17
18
function selectOne<T>(arr: T[]): T {
19
-
return arr[Math.floor(Math.random() * arr.length)];
20
}
21
22
function resolveSide(side: string, currentWeather: DailyWeather) {
···
2
import { voiceLines } from './voice.js';
3
import type { Config } from './index.js';
4
import type { Voice } from './voice.js';
5
+
import crypto from 'crypto';
6
7
type SegmentName = string;
8
type SequenceName = string;
···
17
let config: Config = null;
18
19
function selectOne<T>(arr: T[]): T {
20
+
return arr[crypto.randomInt(0, arr.length)];
21
}
22
23
function resolveSide(side: string, currentWeather: DailyWeather) {
+1
-2
test/sequencer.test.ts
+1
-2
test/sequencer.test.ts