Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -3,7 +3,10 @@ import { page } from '$app/stores';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
/** Keep library working views shareable and restore them on browser Back. */
|
||||
export function saveLibraryContext(values: Record<string, string | number>, defaults: Record<string, string | number> = {}) {
|
||||
export function saveLibraryContext(
|
||||
values: Record<string, string | number>,
|
||||
defaults: Record<string, string | number> = {}
|
||||
) {
|
||||
const url = new URL(window.location.href);
|
||||
for (const [key, value] of Object.entries(values)) {
|
||||
if (value === '' || value === defaults[key]) url.searchParams.delete(key);
|
||||
|
||||
Reference in New Issue
Block a user