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

@tanstack/router-generator

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router-generator - npm Package Compare versions

Comparing version 1.16.0 to 1.16.1

2

dist/esm/generator.d.ts

@@ -24,4 +24,4 @@ import { Config } from './config.js';

export declare function generator(config: Config): Promise<void>;
export declare function removeExt(d: string, enabled?: boolean): string;
export declare function removeExt(d: string, keepExtension?: boolean): string;
export declare function multiSortBy<T>(arr: T[], accessors?: ((item: T) => any)[]): T[];
export declare function hasParentRoute(routes: RouteNode[], routePathToCheck: string | undefined): RouteNode | null;

@@ -109,3 +109,5 @@ import path from "path";

const routePathIdPrefix = config.routeFilePrefix ?? "";
const preRouteNodes = multiSortBy(await getRouteNodes(config), [
const beforeRouteNodes = await getRouteNodes(config);
const rootRouteNode = beforeRouteNodes.find((d) => d.routePath === `/${rootPathId}`);
const preRouteNodes = multiSortBy(beforeRouteNodes, [
(d) => d.routePath === "/" ? -1 : 1,

@@ -261,9 +263,3 @@ (d) => {

const virtualRouteNodes = sortedRouteNodes.filter((d) => d.isVirtual);
const rootPath = routeNodes.find(
(d) => {
var _a;
return (_a = d.routePath) == null ? void 0 : _a.includes(`/${rootPathId}`);
}
);
const rootPathIdExtension = config.addExtensions ? rootPath == null ? void 0 : rootPath.filePath.substring(rootPath == null ? void 0 : rootPath.filePath.lastIndexOf(".")) : "";
const rootPathIdExtension = config.addExtensions && rootRouteNode ? path.extname(rootRouteNode.filePath) : "";
const routeImports = [

@@ -411,4 +407,4 @@ "/* prettier-ignore-start */",

}
function removeExt(d, enabled = true) {
return enabled ? d.substring(0, d.lastIndexOf(".")) || d : d;
function removeExt(d, keepExtension = false) {
return keepExtension ? d : d.substring(0, d.lastIndexOf(".")) || d;
}

@@ -415,0 +411,0 @@ function spaces(d) {

{
"name": "@tanstack/router-generator",
"version": "1.16.0",
"version": "1.16.1",
"description": "",

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

@@ -177,4 +177,6 @@ import path from 'path'

const routePathIdPrefix = config.routeFilePrefix ?? ''
const beforeRouteNodes = await getRouteNodes(config)
const rootRouteNode = beforeRouteNodes.find((d) => d.routePath === `/${rootPathId}`)
const preRouteNodes = multiSortBy(await getRouteNodes(config), [
const preRouteNodes = multiSortBy(beforeRouteNodes, [
(d) => (d.routePath === '/' ? -1 : 1),

@@ -369,10 +371,7 @@ (d) => d.routePath?.split('/').length,

const rootPath = routeNodes.find((d) =>
d.routePath?.includes(`/${rootPathId}`),
)
const rootPathIdExtension =
config.addExtensions && rootRouteNode
? path.extname(rootRouteNode.filePath)
: ''
const rootPathIdExtension = config.addExtensions
? rootPath?.filePath.substring(rootPath?.filePath.lastIndexOf('.'))
: ''
const routeImports = [

@@ -577,4 +576,4 @@ '/* prettier-ignore-start */',

export function removeExt(d: string, enabled: boolean = true) {
return enabled ? d.substring(0, d.lastIndexOf('.')) || d : d
export function removeExt(d: string, keepExtension: boolean = false) {
return keepExtension ? d : d.substring(0, d.lastIndexOf('.')) || d
}

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

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