|
|
@ -1,13 +1,14 @@
|
|
|
|
<script context="module">
|
|
|
|
<script context="module">
|
|
|
|
export function load({ page: { query }}) {
|
|
|
|
export function load({ page: { query } }) {
|
|
|
|
const { gist, example, version } = query;
|
|
|
|
const gist = query.get('gist');
|
|
|
|
|
|
|
|
const example = query.get('example');
|
|
|
|
|
|
|
|
const version = query.get('version');
|
|
|
|
|
|
|
|
|
|
|
|
// redirect to v2 REPL if appropriate
|
|
|
|
// redirect to v2 REPL if appropriate
|
|
|
|
if (/^[^>]?[12]/.test(version)) {
|
|
|
|
if (/^[^>]?[12]/.test(version)) {
|
|
|
|
const q = Object.keys(query).map(key => `${key}=${query[key]}`).join('&');
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
status: 302,
|
|
|
|
status: 302,
|
|
|
|
redirect: `https://v2.svelte.dev/repl?${q}`
|
|
|
|
redirect: `https://v2.svelte.dev/repl?${query}`
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -19,4 +20,4 @@
|
|
|
|
redirect: `/repl/${id}${q}`
|
|
|
|
redirect: `/repl/${id}${q}`
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|