// extract.js
import { array, define } from 'svelte-qparam'
import { boolean, number, string } from 'svelte-qparam/serde'
export const extract = define({
str: string,
num: number,
bool_array: array(boolean)
})
<!-- +page.svelte -->
<script>
import { extract } from 'extract.js'
$: ({ qparams } = extract($page.url))
$: ({ str, num, bool_array } = qparams)
</script>
<output>
<code>page_str = {$str}</code>
<code>page_num = {$num}</code>
<code>page_bool_array = {JSON.stringify($bool_array)}</code>
</output>