Skip to content

Commit

Permalink
Missing types in crypto randomFill & randomFillSync node definitions
Browse files Browse the repository at this point in the history
Summary:
In current definitions `buffer` arg only accepts `Buffer` type, but
according to docs [1] it should accept `Buffer | $TypedArray | DataView`.

[1] https://nodejs.org/api/crypto.html#crypto_crypto_randomfillsync_buffer_offset_size

Pull Request resolved: #8373

Reviewed By: nmote

Differential Revision: D28344647

Pulled By: mroch

fbshipit-source-id: d3d46d93a5eb7e510534f0d19f2b5b09d7aeb37f
  • Loading branch information
juodumas authored and facebook-github-bot committed May 13, 2021
1 parent cd56f01 commit 29f9cae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,24 +672,24 @@ declare module "crypto" {
size: number,
callback: (err: ?Error, buffer: Buffer) => void
): void;
declare function randomFillSync(buffer: Buffer): void
declare function randomFillSync(buffer: Buffer, offset: number): void
declare function randomFillSync(buffer: Buffer | $TypedArray | DataView): void
declare function randomFillSync(buffer: Buffer | $TypedArray | DataView, offset: number): void
declare function randomFillSync(
buffer: Buffer,
buffer: Buffer | $TypedArray | DataView,
offset: number,
size: number
): void
declare function randomFill(
buffer: Buffer,
buffer: Buffer | $TypedArray | DataView,
callback: (err: ?Error, buffer: Buffer) => void
): void
declare function randomFill(
buffer: Buffer,
buffer: Buffer | $TypedArray | DataView,
offset: number,
callback: (err: ?Error, buffer: Buffer) => void
): void
declare function randomFill(
buffer: Buffer,
buffer: Buffer | $TypedArray | DataView,
offset: number,
size: number,
callback: (err: ?Error, buffer: Buffer) => void
Expand Down

0 comments on commit 29f9cae

Please sign in to comment.