New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sveltekit-search-params

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sveltekit-search-params - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

LICENSE

2

package.json
{
"name": "sveltekit-search-params",
"version": "1.0.3",
"version": "1.0.4",
"repository": "git+https://github.com/paoloricciuti/sveltekit-search-params.git",

@@ -5,0 +5,0 @@ "author": "Paolo Ricciuti",

/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { writable, get } from 'svelte/store';
import { goto, afterNavigate } from '$app/navigation';
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { browser } from '$app/environment';
import { decompressFromEncodedURIComponent, compressToEncodedURIComponent } from "./lz-string/index.js";
import { get, writable } from 'svelte/store';
import { compressToEncodedURIComponent, decompressFromEncodedURIComponent } from "./lz-string/index.js";
// eslint-disable-next-line @typescript-eslint/no-unused-vars

@@ -106,8 +106,2 @@ function noop(value) { }

export function queryParameters(options, { debounceHistory = 0, pushHistory = true, } = {}) {
let pushHistoryCb = null;
afterNavigate(() => {
if (pushHistoryCb) {
pushHistoryCb();
}
});
const { set: _set, subscribe } = writable();

@@ -134,14 +128,11 @@ const setRef = { value: noop };

clearTimeout(batchTimeout);
batchTimeout = setTimeout(() => {
batchTimeout = setTimeout(async () => {
batchedUpdates.forEach((batched) => {
batched(query);
});
goto(`?${query}`, GOTO_OPTIONS);
clearTimeout(debouncedTimeouts.get("queryParameters"));
await goto(`?${query}`, GOTO_OPTIONS);
if (pushHistory) {
debouncedTimeouts.set("queryParameters", setTimeout(() => {
pushHistoryCb = () => {
goto("", GOTO_OPTIONS_PUSH);
pushHistoryCb = null;
};
goto("", GOTO_OPTIONS_PUSH);
}, debounceHistory));

@@ -184,8 +175,2 @@ }

export function queryParam(name, { encode: encode = DEFAULT_ENCODER_DECODER.encode, decode: decode = DEFAULT_ENCODER_DECODER.decode, defaultValue } = DEFAULT_ENCODER_DECODER, { debounceHistory = 0, pushHistory = true, } = {}) {
let pushHistoryCb = null;
afterNavigate(() => {
if (pushHistoryCb) {
pushHistoryCb();
}
});
const { set: _set, subscribe } = writable();

@@ -207,14 +192,11 @@ const setRef = { value: noop };

const query = new URLSearchParams($page.url.searchParams);
batchTimeout = setTimeout(() => {
batchTimeout = setTimeout(async () => {
batchedUpdates.forEach((batched) => {
batched(query);
});
goto(`?${query}`, GOTO_OPTIONS);
clearTimeout(debouncedTimeouts.get(name));
await goto(`?${query}`, GOTO_OPTIONS);
if (pushHistory) {
debouncedTimeouts.set(name, setTimeout(() => {
pushHistoryCb = () => {
goto("", GOTO_OPTIONS_PUSH);
pushHistoryCb = null;
};
goto("", GOTO_OPTIONS_PUSH);
}, debounceHistory));

@@ -221,0 +203,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc