MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getEmbeddedUrl

Method getEmbeddedUrl

static/sharing.ts:471–490  ·  view source on GitHub ↗
(config: any, root: string, readOnly: boolean, extraOptions: object)

Source from the content-addressed store, hash-verified

469 }
470
471 private static getEmbeddedUrl(config: any, root: string, readOnly: boolean, extraOptions: object): string {
472 const location = window.location.origin + root;
473 const parameters = _.reduce(
474 extraOptions,
475 (total, value, key): string => {
476 if (total === '') {
477 total = '?';
478 } else {
479 total += '&';
480 }
481
482 return total + key + '=' + value;
483 },
484 '',
485 );
486
487 const path = (readOnly ? 'embed-ro' : 'e') + parameters + '#';
488
489 return location + path + serialiseState(config);
490 }
491
492 private static storeCurrentConfig(config: any, extra: string): void {
493 window.history.pushState(null, '', extra);

Callers 1

getEmbeddedHtmlMethod · 0.80

Calls 1

serialiseStateFunction · 0.85

Tested by

no test coverage detected