MCPcopy
hub / github.com/graphql/graphiql / guid

Function guid

packages/graphiql-react/src/editor/tabs.ts:336–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334}
335
336function guid(): string {
337 const s4 = () => {
338 return Math.floor((1 + Math.random()) * 0x10000)
339 .toString(16)
340 .slice(1);
341 };
342 // return id of format 'aaaaaaaa'-'aaaa'-'aaaa'-'aaaa'-'aaaaaaaaaaaa'
343 return `${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
344}
345
346function hashFromTabContents(args: {
347 query: string | null;

Callers 2

getDefaultTabStateFunction · 0.85
createTabFunction · 0.85

Calls 1

s4Function · 0.85

Tested by

no test coverage detected