Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace seed-random by seedrandom #1955

Merged
merged 1 commit into from
Sep 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"escape-latex": "^1.2.0",
"fraction.js": "^4.0.12",
"javascript-natural-sort": "^0.7.1",
"seed-random": "^2.2.0",
"seedrandom": "^3.0.5",
"tiny-emitter": "^2.1.0",
"typed-function": "^2.0.0"
},
Expand Down
10 changes: 2 additions & 8 deletions src/function/probability/util/seededRNG.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// create a random seed here to prevent an infinite loop from seed-random
// inside the factory. Reason is that math.random is defined as a getter/setter
// and seed-random generates a seed from the local entropy by reading every
// defined object including `math` itself. That means that whilst getting
// math.random, it tries to get math.random, etc... an infinite loop.
// See https://github.com/ForbesLindesay/seed-random/issues/6
import seedrandom from 'seed-random'
import seedrandom from 'seedrandom'

const singletonRandom = /* #__PURE__ */ seedrandom()
const singletonRandom = /* #__PURE__ */ seedrandom(Date.now())

export function createRng (randomSeed) {
let random
Expand Down
2 changes: 1 addition & 1 deletion test/node-tests/treeShaking/treeShaking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('tree shaking', function () {
// this may grow or shrink in the future
assert.strictEqual(info.assets[0].name, bundleName)
const size = info.assets[0].size
const maxSize = 100000
const maxSize = 110000
assert(size < maxSize,
'bundled size must be small enough ' +
'(actual size: ' + size + ' bytes, max size: ' + maxSize + ' bytes)')
Expand Down