diff options
author | Mark Ladyshau <47859603+mrkldshv@users.noreply.github.com> | 2022-06-02 15:15:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-02 15:15:46 +0200 |
commit | 4e26bcb2bb748a810614dd0645c41a58f5a53154 (patch) | |
tree | a71b89511b905995ad9dda565c3ac47091ec0a15 | |
parent | d78fd8ec39a02b137c1954255f3856a7aa07617e (diff) |
fix(ext/crypto): adjust `getRandomValues` types (#14714)
-rw-r--r-- | cli/tests/unit/get_random_values_test.ts | 12 | ||||
-rw-r--r-- | ext/crypto/lib.deno_crypto.d.ts | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/cli/tests/unit/get_random_values_test.ts b/cli/tests/unit/get_random_values_test.ts index 4df22f697..29c8365ea 100644 --- a/cli/tests/unit/get_random_values_test.ts +++ b/cli/tests/unit/get_random_values_test.ts @@ -37,12 +37,24 @@ Deno.test(function getRandomValuesInt32Array() { assertNotEquals(arr, new Int32Array(8)); }); +Deno.test(function getRandomValuesBigInt64Array() { + const arr = new BigInt64Array(8); + crypto.getRandomValues(arr); + assertNotEquals(arr, new BigInt64Array(8)); +}); + Deno.test(function getRandomValuesUint32Array() { const arr = new Uint32Array(8); crypto.getRandomValues(arr); assertNotEquals(arr, new Uint32Array(8)); }); +Deno.test(function getRandomValuesBigUint64Array() { + const arr = new BigUint64Array(8); + crypto.getRandomValues(arr); + assertNotEquals(arr, new BigUint64Array(8)); +}); + Deno.test(function getRandomValuesReturnValue() { const arr = new Uint32Array(8); const rtn = crypto.getRandomValues(arr); diff --git a/ext/crypto/lib.deno_crypto.d.ts b/ext/crypto/lib.deno_crypto.d.ts index a5c775a02..7f7703e88 100644 --- a/ext/crypto/lib.deno_crypto.d.ts +++ b/ext/crypto/lib.deno_crypto.d.ts @@ -326,8 +326,8 @@ declare interface Crypto { | Uint16Array | Uint32Array | Uint8ClampedArray - | Float32Array - | Float64Array + | BigInt64Array + | BigUint64Array | DataView | null, >( |