Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make UnorderedMap and Set helper methods private #179

Merged
merged 2 commits into from
Aug 18, 2022
Merged

Conversation

ailisp
Copy link
Member

@ailisp ailisp commented Aug 17, 2022

Fix #83

@ailisp ailisp requested review from volovyks and austinabell August 17, 2022 09:04
Comment on lines 43 to 58
private serializeIndex(index: number): Bytes {
let data = new Uint32Array([index]);
let array = new Uint8Array(data.buffer);
return u8ArrayToBytes(array);
}

deserializeIndex(rawIndex: Bytes) {
private deserializeIndex(rawIndex: Bytes) {
let array = bytesToU8Array(rawIndex);
let data = new Uint32Array(array.buffer);
return data[0];
}

getIndexRaw(key: Bytes): Bytes {
private getIndexRaw(key: Bytes): Bytes {
let indexLookup = this.keyIndexPrefix + JSON.stringify(key);
let indexRaw = near.storageRead(indexLookup);
return indexRaw;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these associated functions to begin with? Can't these live outside of the structure to avoid misuse (when ignoring or not using TS types)?

@ailisp ailisp merged commit d09554b into develop Aug 18, 2022
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.

Switch APIs of internal collection functions to indicate private
3 participants