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

@pinnacle0/react-stack-router

Package Overview
Dependencies
Maintainers
5
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pinnacle0/react-stack-router - npm Package Compare versions

Comparing version 0.1.3-beta.0 to 0.1.3-beta.1

1

lib/route/index.d.ts

@@ -35,3 +35,4 @@ export interface RouteNode<T> {

}
export declare function pathToSegments(path: string): string[];
export declare function formatPath(path: string): string;
//# sourceMappingURL=index.d.ts.map

20

lib/route/index.js

@@ -11,4 +11,3 @@ import { invariant } from "../invariant";

this.cache.clear();
const formattedPath = formatPath(path);
const segments = formattedPath === "/" ? ["/"] : formattedPath.split("/");
const segments = pathToSegments(path);
let currentNode = this.root;

@@ -40,4 +39,3 @@ for (const segment of segments) {

freshLookup(path) {
const formattedPath = formatPath(path);
const segments = formattedPath === "/" ? ["/"] : formattedPath.split("/");
const segments = pathToSegments(path);
let params = {};

@@ -113,2 +111,12 @@ let nextNode = this.root;

}
export function pathToSegments(path) {
let formattedPath = formatPath(path);
const segments = [];
if (formattedPath.startsWith("/")) {
segments.push("/");
formattedPath = formattedPath.substring(1);
}
formattedPath.split("/").forEach(_ => _.length > 0 && segments.push(_));
return segments;
}
export function formatPath(path) {

@@ -122,8 +130,4 @@ let formatted = path.replaceAll(/[/]+/g, "/");

}
// removed leading '/'
if (formatted[0] === "/") {
formatted = formatted.slice(1);
}
return formatted;
}
//# sourceMappingURL=index.js.map
{
"name": "@pinnacle0/react-stack-router",
"version": "0.1.3-beta.0",
"version": "0.1.3-beta.1",
"author": "Pinnacle",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -35,4 +35,3 @@ import {invariant} from "../invariant";

this.cache.clear();
const formattedPath = formatPath(path);
const segments = formattedPath === "/" ? ["/"] : formattedPath.split("/");
const segments = pathToSegments(path);

@@ -66,5 +65,4 @@ let currentNode: RouteNode<T> = this.root;

private freshLookup(path: string): Match<T> | null {
const formattedPath = formatPath(path);
const segments = pathToSegments(path);
const segments = formattedPath === "/" ? ["/"] : formattedPath.split("/");
let params: Record<string, string> = {};

@@ -146,2 +144,15 @@ let nextNode: RouteNode<T> = this.root;

export function pathToSegments(path: string): string[] {
let formattedPath = formatPath(path);
const segments = [];
if (formattedPath.startsWith("/")) {
segments.push("/");
formattedPath = formattedPath.substring(1);
}
formattedPath.split("/").forEach(_ => _.length > 0 && segments.push(_));
return segments;
}
export function formatPath(path: string): string {

@@ -157,8 +168,3 @@ let formatted = path.replaceAll(/[/]+/g, "/");

// removed leading '/'
if (formatted[0] === "/") {
formatted = formatted.slice(1);
}
return formatted;
}

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