davidbau / seedrandom

seeded random number generator for Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ivanjeremic opened this issue · comments

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

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

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"