Socket
Socket
Sign inDemoInstall

@solidjs/router

Package Overview
Dependencies
Maintainers
3
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solidjs/router - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

11

dist/index.js

@@ -151,5 +151,5 @@ import { isServer, delegateEvents, createComponent as createComponent$1, spread, mergeProps as mergeProps$1, template } from 'solid-js/web';

const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
const trimPathRegex = /^\/+|\/+$/g;
const trimPathRegex = /^\/+|(\/)\/+$/g;
function normalizePath(path, omitSlash = false) {
const s = path.replace(trimPathRegex, "");
const s = path.replace(trimPathRegex, "$1");
return s ? omitSlash || /^[?#]/.test(s) ? s : "/" + s : "";

@@ -207,6 +207,7 @@ }

const locSegment = locSegments[i];
const key = segment[0] === ":" ? segment.slice(1) : segment;
if (segment[0] === ":" && matchSegment(locSegment, matchFilter(key))) {
const dynamic = segment[0] === ":";
const key = dynamic ? segment.slice(1) : segment;
if (dynamic && matchSegment(locSegment, matchFilter(key))) {
match.params[key] = locSegment;
} else if (!matchSegment(locSegment, segment)) {
} else if (dynamic || !matchSegment(locSegment, segment)) {
return null;

@@ -213,0 +214,0 @@ }

import { createMemo, getOwner, runWithOwner } from "solid-js";
const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
const trimPathRegex = /^\/+|\/+$/g;
const trimPathRegex = /^\/+|(\/)\/+$/g;
export function normalizePath(path, omitSlash = false) {
const s = path.replace(trimPathRegex, "");
const s = path.replace(trimPathRegex, "$1");
return s ? (omitSlash || /^[?#]/.test(s) ? s : "/" + s) : "";

@@ -60,7 +60,8 @@ }

const locSegment = locSegments[i];
const key = segment[0] === ":" ? segment.slice(1) : segment;
if (segment[0] === ":" && matchSegment(locSegment, matchFilter(key))) {
const dynamic = segment[0] === ":";
const key = dynamic ? segment.slice(1) : segment;
if (dynamic && matchSegment(locSegment, matchFilter(key))) {
match.params[key] = locSegment;
}
else if (!matchSegment(locSegment, segment)) {
else if (dynamic || !matchSegment(locSegment, segment)) {
return null;

@@ -67,0 +68,0 @@ }

@@ -9,3 +9,3 @@ {

"license": "MIT",
"version": "0.7.0",
"version": "0.7.1",
"homepage": "https://github.com/solidjs/solid-router#readme",

@@ -12,0 +12,0 @@ "repository": {

@@ -536,3 +536,3 @@ <p>

<span>Page: {searchParams.page}</span>
<button onClick={() => setSearchParams({ page: searchParams.page + 1 })}>Next Page</button>
<button onClick={() => setSearchParams({ page: (parseInt(searchParams.page) || 0) + 1 })}>Next Page</button>
</div>

@@ -539,0 +539,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