Skip to content

Conversation

harmony7
Copy link
Member

@harmony7 harmony7 commented Oct 10, 2025

This PR corrects the documented return type of SecretStoreEntry.prototype.rawBytes() to Uint8Array.

The current docs incorrectly describes the return type of SecretStoreEntry.prototype.rawBytes() as ArrayBuffer.

The correct return type is Uint8Array:

/**
* Get the raw byte value of the SecretStoreEntry as a Uint8Array.
*
* Note: Using this method will bring the secret into user memory,
* always avoid using this method when possible, instead passing
* the secret directly.
*/
rawBytes(): Uint8Array;

It is validated in this test:

let result;
result = SecretStore.fromBytes(new Uint8Array([1, 2, 3]));
assert(
result instanceof SecretStoreEntry,
true,
`(SecretStore.fromBytes(Uint8Array) instanceof SecretStoreEntry)`,
);
assert(
result.rawBytes(),
new Uint8Array([1, 2, 3]),
`(SecretStore.fromBytes(Uint8Array).rawBytes() === Uint8Array)`,
);

@harmony7 harmony7 requested review from TartanLlama and zkat October 10, 2025 06:52
@TartanLlama TartanLlama merged commit f9d6a12 into main Oct 10, 2025
28 of 29 checks passed
@TartanLlama TartanLlama deleted the kats/docfix-rawbytes branch October 10, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants