MCPcopy Create free account
hub / github.com/backstrokeapp/server / generateId

Function generateId

src/test-helpers/create-mock-github-instance.js:3–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1let _existingIds = [];
2const MAX_ID = 10000000;
3export function generateId() {
4 let id;
5 do {
6 id = Math.floor(Math.random() * MAX_ID);
7 } while (_existingIds.indexOf(id) !== -1);
8
9 _existingIds.push(id);
10 return id;
11}
12
13export function generateSha() {
14 let sha = '';

Callers 4

generateOwnerFunction · 0.85
generateRepoFunction · 0.85
pullRequestsCreateFunction · 0.85
reposCreateHookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected