Skip to content

Commit 7eff835

Browse files
authored
fix: tsconfig module type (#778)
1 parent 1e0f987 commit 7eff835

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"@commitlint/config-conventional": "19.2.2",
5555
"@eslint/js": "9.5.0",
5656
"@types/eslint__js": "8.42.3",
57-
"@types/random-seed": "0.3.5",
5857
"@wdio/browserstack-service": "8.39.0",
5958
"@wdio/cli": "8.39.0",
6059
"@wdio/jasmine-framework": "8.39.0",
@@ -73,7 +72,6 @@
7372
"npm-run-all": "4.1.5",
7473
"optional-dev-dependency": "2.0.1",
7574
"prettier": "3.3.2",
76-
"random-seed": "0.3.0",
7775
"runmd": "1.3.9",
7876
"standard-version": "9.5.0",
7977
"typescript": "5.4.5",

src/test/parse.test.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
import * as assert from 'assert';
22
import test, { describe } from 'node:test';
3-
// @ts-expect-error random-seed is an old CJS module. we should update an ESM seeded
4-
// RNG at some point, but keeping this for now to ensure the TS port works with
5-
// the legacy tests here.
6-
import gen from 'random-seed';
73
import parse from '../parse.js';
84
import stringify from '../stringify.js';
95
import uuidv4 from '../v4.js';
106

11-
// Use deterministic PRNG for reproducible tests
12-
const rand = gen.create('He who wonders discovers that this in itself is wonder.');
7+
// Deterministic PRNG for reproducible tests
8+
// See https://stackoverflow.com/a/47593316/109538
9+
function splitmix32(a: number) {
10+
return function () {
11+
a |= 0;
12+
a = (a + 0x9e3779b9) | 0;
13+
let t = a ^ (a >>> 16);
14+
t = Math.imul(t, 0x21f0aaad);
15+
t = t ^ (t >>> 15);
16+
t = Math.imul(t, 0x735a2d97);
17+
return ((t = t ^ (t >>> 15)) >>> 0) / 4294967296;
18+
};
19+
}
20+
const rand = splitmix32(0x12345678);
1321

1422
function rng(bytes = new Uint8Array(16)) {
1523
for (let i = 0; i < 16; i++) {
16-
bytes[i] = rand(256);
24+
bytes[i] = rand() * 256;
1725
}
26+
1827
return bytes;
1928
}
2029

tsconfig.esm.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
4-
"module": "ESNext",
5-
"moduleResolution": "Node",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
66
"outDir": "./dist/esm"
77
}
88
}

0 commit comments

Comments
 (0)