Skip to content

Commit 62a8f87

Browse files
authored
fix: cast getRandomValues result and fix CI tsc error detection (#963)
1 parent e9ec818 commit 62a8f87

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/validate-js.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ jobs:
4848
4949
- name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m
5050
run: |
51-
bun tsc | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
51+
set -o pipefail
52+
bun tsc 2>&1 | sed 's/^[^ ]* typescript: //' | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee
5253
env:
5354
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5455

example/src/tests/subtle/wrap_unwrap.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test(SUITE, 'wrap/unwrap AES-256 with AES-KW', async () => {
4141
);
4242

4343
// Verify keys are functionally identical
44-
const plaintext = getRandomValues(new Uint8Array(32));
44+
const plaintext = getRandomValues(new Uint8Array(32)) as Uint8Array;
4545
const iv = getRandomValues(new Uint8Array(12));
4646

4747
const ct1 = await subtle.encrypt(
@@ -184,7 +184,7 @@ test(SUITE, 'wrap/unwrap with AES-CBC', async () => {
184184
['encrypt', 'decrypt'],
185185
);
186186

187-
const plaintext = getRandomValues(new Uint8Array(32));
187+
const plaintext = getRandomValues(new Uint8Array(32)) as Uint8Array;
188188
const gcmIv = getRandomValues(new Uint8Array(12));
189189

190190
const ct = await subtle.encrypt(
@@ -237,7 +237,7 @@ test(SUITE, 'wrap/unwrap with AES-OCB', async () => {
237237
['encrypt', 'decrypt'],
238238
);
239239

240-
const plaintext = getRandomValues(new Uint8Array(32));
240+
const plaintext = getRandomValues(new Uint8Array(32)) as Uint8Array;
241241
const gcmIv = getRandomValues(new Uint8Array(12));
242242

243243
const ct = await subtle.encrypt(
@@ -343,7 +343,7 @@ test(SUITE, 'wrap/unwrap with RSA-OAEP', async () => {
343343
['encrypt', 'decrypt'],
344344
);
345345

346-
const plaintext = getRandomValues(new Uint8Array(32));
346+
const plaintext = getRandomValues(new Uint8Array(32)) as Uint8Array;
347347
const iv = getRandomValues(new Uint8Array(12));
348348

349349
const ct = await subtle.encrypt(
@@ -396,7 +396,7 @@ test(SUITE, 'wrap/unwrap with ChaCha20-Poly1305', async () => {
396396
['encrypt', 'decrypt'],
397397
);
398398

399-
const plaintext = getRandomValues(new Uint8Array(32));
399+
const plaintext = getRandomValues(new Uint8Array(32)) as Uint8Array;
400400
const gcmIv = getRandomValues(new Uint8Array(12));
401401

402402
const ct = await subtle.encrypt(

0 commit comments

Comments
 (0)