Socket
Socket
Sign inDemoInstall

@tanstack/react-router

Package Overview
Dependencies
Maintainers
0
Versions
581
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/react-router - npm Package Compare versions

Comparing version 1.39.6 to 1.39.7

15

dist/esm/path.js

@@ -121,6 +121,15 @@ import { last } from "./utils.js";

const interpolatedPathSegments = parsePathname(path);
const encodedParams = {};
for (const [key, value] of Object.entries(params)) {
const isValueString = typeof value === "string";
if (["*", "_splat"].includes(key)) {
encodedParams[key] = isValueString ? encodeURI(value) : value;
} else {
encodedParams[key] = isValueString ? encodeURIComponent(value) : value;
}
}
return joinPaths(
interpolatedPathSegments.map((segment) => {
if (segment.type === "wildcard") {
const value = params._splat;
const value = encodedParams._splat;
if (leaveWildcards)

@@ -132,6 +141,6 @@ return `${segment.value}${value ?? ""}`;

if (leaveParams) {
const value = params[segment.value];
const value = encodedParams[segment.value];
return `${segment.value}${value ?? ""}`;
}
return params[segment.value.substring(1)] ?? "undefined";
return encodedParams[segment.value.substring(1)] ?? "undefined";
}

@@ -138,0 +147,0 @@ return segment.value;

@@ -433,9 +433,2 @@ import { createBrowserHistory, createMemoryHistory } from "@tanstack/history";

}
Object.keys(nextParams).forEach((key) => {
if (["*", "_splat"].includes(key)) {
nextParams[key] = encodeURI(nextParams[key]);
} else {
nextParams[key] = encodeURIComponent(nextParams[key]);
}
});
pathname = interpolatePath({

@@ -442,0 +435,0 @@ path: pathname,

2

package.json
{
"name": "@tanstack/react-router",
"version": "1.39.6",
"version": "1.39.7",
"description": "",

@@ -5,0 +5,0 @@ "author": "Tanner Linsley",

@@ -208,7 +208,19 @@ import { last } from './utils'

const interpolatedPathSegments = parsePathname(path)
const encodedParams: any = {}
for (const [key, value] of Object.entries(params)) {
const isValueString = typeof value === 'string'
if (['*', '_splat'].includes(key)) {
// the splat/catch-all routes shouldn't have the '/' encoded out
encodedParams[key] = isValueString ? encodeURI(value) : value
} else {
encodedParams[key] = isValueString ? encodeURIComponent(value) : value
}
}
return joinPaths(
interpolatedPathSegments.map((segment) => {
if (segment.type === 'wildcard') {
const value = params._splat
const value = encodedParams._splat
if (leaveWildcards) return `${segment.value}${value ?? ''}`

@@ -220,6 +232,6 @@ return value

if (leaveParams) {
const value = params[segment.value]
const value = encodedParams[segment.value]
return `${segment.value}${value ?? ''}`
}
return params![segment.value.substring(1)] ?? 'undefined'
return encodedParams![segment.value.substring(1)] ?? 'undefined'
}

@@ -226,0 +238,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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