Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function pushUrlParams(urlParams: PlaygroundUrlParams) {
const query = stringifyPlaygroundUrlQuery(urlParams);
// Refresh page completely when pushState isn't supported
if (!history.pushState) {
location.search = query;
return;
}
// Update URL without refreshing page
history.pushState({}, '', createRelativeUrlWithQuery(query));
}
function createFixtureUrl(
host: string,
fixtureId: FixtureId,
fullScreen: boolean
) {
if (fullScreen) {
const query = stringifyRendererUrlQuery({ _fixtureId: fixtureId });
return `${host}/${RENDERER_FILENAME}?${query}`;
}
const query = stringifyPlaygroundUrlQuery({ fixtureId });
return `${host}/?${query}`;
}
export function createRelativePlaygroundUrl(urlParams: PlaygroundUrlParams) {
const query = stringifyPlaygroundUrlQuery(urlParams);
return createRelativeUrlWithQuery(query);
}