Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tanstack/virtual-file-routes

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/virtual-file-routes - npm Package Compare versions

Comparing version 1.56.0 to 1.64.0

4

dist/esm/api.d.ts

@@ -6,3 +6,5 @@ import { IndexRoute, LayoutRoute, PhysicalSubtree, Route, VirtualRootRoute, VirtualRouteNode } from './types.js';

export declare function layout(id: string, file: string, children: Array<VirtualRouteNode>): LayoutRoute;
export declare function route(path: string, file: string, children?: Array<VirtualRouteNode>): Route;
export declare function route(path: string, children: Array<VirtualRouteNode>): Route;
export declare function route(path: string, file: string): Route;
export declare function route(path: string, file: string, children: Array<VirtualRouteNode>): Route;
export declare function physical(pathPrefix: string, directory: string): PhysicalSubtree;

@@ -30,8 +30,15 @@ function rootRoute(file, children) {

}
function route(path, file, children) {
function route(path, fileOrChildren, children) {
if (typeof fileOrChildren === "string") {
return {
type: "route",
file: fileOrChildren,
path,
children
};
}
return {
type: "route",
file,
path,
children
children: fileOrChildren
};

@@ -38,0 +45,0 @@ }

@@ -18,3 +18,3 @@ export type IndexRoute = {

type: 'route';
file: string;
file?: string;
path: string;

@@ -21,0 +21,0 @@ children?: Array<VirtualRouteNode>;

{
"name": "@tanstack/virtual-file-routes",
"version": "1.56.0",
"version": "1.64.0",
"description": "Modern and scalable routing for React applications",

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

@@ -59,12 +59,26 @@ import type {

export function route(path: string, children: Array<VirtualRouteNode>): Route
export function route(path: string, file: string): Route
export function route(
path: string,
file: string,
children: Array<VirtualRouteNode>,
): Route
export function route(
path: string,
fileOrChildren: string | Array<VirtualRouteNode>,
children?: Array<VirtualRouteNode>,
): Route {
if (typeof fileOrChildren === 'string') {
return {
type: 'route',
file: fileOrChildren,
path,
children,
}
}
return {
type: 'route',
file,
path,
children,
children: fileOrChildren,
}

@@ -71,0 +85,0 @@ }

@@ -21,3 +21,3 @@ export type IndexRoute = {

type: 'route'
file: string
file?: string
path: string

@@ -24,0 +24,0 @@ children?: Array<VirtualRouteNode>

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

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