davidbau / seedrandom

seeded random number generator for Javascript
2.04k stars 160 forks source link

This package is using eval(); any more modern way to avoid this? #75

Closed ivanjeremic closed 2 years ago

ivanjeremic commented 2 years ago

This package is used in one of my deps which I need in my cloudflare worker but they don't allow eval() is there any more modern way to rewrite this without eval?

Uncaught EvalError: Code generation from strings disallowed for this context
  at line 2
  at line 2 in ./node_modules/seedrandom/seedrandom.js
  at line 2 in s
  at line 2 in ./node_modules/seedrandom/index.js
  at line 2 in s
  at line 2 in ./node_modules/@tensorflow/tfjs-data/dist/dataset.js
  at line 2 in s
  at line 2 in ./node_modules/@tensorflow/tfjs-data/dist/index.js
  at line 2 in s
  at line 2 in ./node_modules/@tensorflow/tfjs/dist/index.js
davidbau commented 2 years ago

Which version are you seeing the error with? Version 3.0.5 removed eval, so likely an upgrade will fix it for you.

ivanjeremic commented 2 years ago

Which version are you seeing the error with? Version 3.0.5 removed eval, so likely an upgrade will fix it for you.

I use a package that uses seedrandom as peer dependencies version "~2.4.3"