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.4 to 1.39.6

15

dist/esm/path.js

@@ -148,3 +148,16 @@ import { last } from "./utils.js";

function removeBasepath(basepath, pathname) {
return basepath != "/" ? pathname.replace(basepath, "") : pathname;
switch (true) {
case basepath === "/":
return pathname;
case pathname === basepath:
return "";
case pathname.length < basepath.length:
return pathname;
case pathname[basepath.length] !== "/":
return pathname;
case pathname.startsWith(basepath):
return pathname.slice(basepath.length);
default:
return pathname;
}
}

@@ -151,0 +164,0 @@ function matchByPath(basepath, from, matchLocation) {

2

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

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

@@ -85,2 +85,3 @@ import { last } from './utils'

}
export function resolvePath({

@@ -200,2 +201,3 @@ basepath,

}
export function interpolatePath({

@@ -246,3 +248,32 @@ path,

export function removeBasepath(basepath: string, pathname: string) {
return basepath != '/' ? pathname.replace(basepath, '') : pathname
switch (true) {
// default behaviour is to serve app from the root - pathname
// left untouched
case basepath === '/':
return pathname
// shortcut for removing the basepath from the equal pathname
case pathname === basepath:
return ''
// in case pathname is shorter than basepath - there is
// nothing to remove
case pathname.length < basepath.length:
return pathname
// avoid matching partial segments - strict equality handled
// earlier, otherwise, basepath separated from pathname with
// separator, therefore lack of separator means partial
// segment match (`/app` should not match `/application`)
case pathname[basepath.length] !== '/':
return pathname
// remove the basepath from the pathname in case there is any
case pathname.startsWith(basepath):
return pathname.slice(basepath.length)
// otherwise, return the pathname as is
default:
return pathname
}
}

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

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