You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
344 B
15 lines
344 B
2 years ago
|
import { PRNG } from 'seedrandom'
|
||
|
|
||
|
export const UsedForbiddenRNG = Error('used random number generation and was not supposed to')
|
||
|
|
||
|
function forbidRNG(): never {
|
||
|
throw UsedForbiddenRNG
|
||
|
}
|
||
|
|
||
|
export const forbiddenRNG: PRNG = Object.assign(forbidRNG, {
|
||
|
double: forbidRNG,
|
||
|
int32: forbidRNG,
|
||
|
quick: forbidRNG,
|
||
|
state: forbidRNG,
|
||
|
})
|