MCPcopy Create free account
hub / github.com/CommE2E/comm / vectorToArray

Function vectorToArray

web/shared-worker/utils/vector-utils.js:16–29  ·  view source on GitHub ↗
(vector: ?EmscriptenVector<T>)

Source from the content-addressed store, hash-verified

14};
15
16function vectorToArray<T>(vector: ?EmscriptenVector<T>): Array<T> {
17 if (!vector || typeof vector.size !== 'function') {
18 return [];
19 }
20
21 const size = vector.size();
22 const array = [];
23
24 for (let i = 0; i < size; i++) {
25 array.push(vector.get(i));
26 }
27
28 return array;
29}
30
31function arrayToStringVector(
32 array: $ReadOnlyArray<string>,

Callers 15

getAllDraftsMethod · 0.90
getInitialMessagesMethod · 0.90
fetchMessagesMethod · 0.90
getAllReportsMethod · 0.90
getAllUsersMethod · 0.90
getAllThreadsMethod · 0.90
getAllKeyserversMethod · 0.90
getAllCommunitiesMethod · 0.90
getAllSyncedMetadataMethod · 0.90
getAllAuxUserInfosMethod · 0.90

Calls 2

pushMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected