1import _lodash from 'lodash'2import seedrandom from 'seedrandom'3import type { LoDashStatic } from 'lodash'5export { seedrandom }7export const seedLodash = (seed: string): LoDashStatic => {8 const orig = Math.random9 seedrandom(seed, { global: true })10 const lodash = _lodash.runInContext()11 Math.random = orig12 return lodash13}15export const seededShuffle = <T,>(seed: string, arr: T[]): T[] => {16 const seededLodash = seedLodash(seed)17 return seededLodash.shuffle(arr)18}