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.54.0 to 1.55.0

1

dist/esm/generator.d.ts
import { RouteNode } from './types.js';
import { Config } from './config.js';
export declare function generator(config: Config): Promise<void>;
export declare function multiSortBy<T>(arr: Array<T>, accessors?: Array<(item: T) => any>): Array<T>;
/**

@@ -6,0 +5,0 @@ * Removes the last segment from a given path. Segments are considered to be separated by a '/'.

@@ -5,3 +5,3 @@ import path from "node:path";

import * as prettier from "prettier";
import { logging, replaceBackslash, removeExt, removeUnderscores, removeTrailingSlash, determineInitialRoutePath, trimPathLeft, routePathToVariable } from "./utils.js";
import { logging, multiSortBy, replaceBackslash, removeExt, removeUnderscores, removeTrailingSlash, determineInitialRoutePath, trimPathLeft, routePathToVariable } from "./utils.js";
import { getRouteNodes as getRouteNodes$1 } from "./filesystem/physical/getRouteNodes.js";

@@ -493,21 +493,2 @@ import { getRouteNodes } from "./filesystem/virtual/getRouteNodes.js";

}
function multiSortBy(arr, accessors = [(d) => d]) {
return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
for (const accessor of accessors) {
const ao = accessor(a);
const bo = accessor(b);
if (typeof ao === "undefined") {
if (typeof bo === "undefined") {
continue;
}
return 1;
}
if (ao === bo) {
continue;
}
return ao > bo ? 1 : -1;
}
return ai - bi;
}).map(([d]) => d);
}
function removeTrailingUnderscores(s) {

@@ -611,3 +592,2 @@ return s == null ? void 0 : s.replaceAll(/(_$)/gi, "").replaceAll(/(_\/)/gi, "/");

inferPath,
multiSortBy,
removeLastSegmentFromPath,

@@ -614,0 +594,0 @@ startAPIRouteSegmentsFromTSRFilePath

1

dist/esm/utils.d.ts

@@ -0,1 +1,2 @@

export declare function multiSortBy<T>(arr: Array<T>, accessors?: Array<(item: T) => any>): Array<T>;
export declare function cleanPath(path: string): string;

@@ -2,0 +3,0 @@ export declare function trimPathLeft(path: string): string;

@@ -0,1 +1,20 @@

function multiSortBy(arr, accessors = [(d) => d]) {
return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
for (const accessor of accessors) {
const ao = accessor(a);
const bo = accessor(b);
if (typeof ao === "undefined") {
if (typeof bo === "undefined") {
continue;
}
return 1;
}
if (ao === bo) {
continue;
}
return ao > bo ? 1 : -1;
}
return ai - bi;
}).map(([d]) => d);
}
function cleanPath(path) {

@@ -57,2 +76,3 @@ return path.replace(/\/{2,}/g, "/");

logging,
multiSortBy,
removeExt,

@@ -59,0 +79,0 @@ removeLeadingSlash,

{
"name": "@tanstack/router-generator",
"version": "1.54.0",
"version": "1.55.0",
"description": "Modern and scalable routing for React applications",

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

@@ -8,2 +8,3 @@ import path from 'node:path'

logging,
multiSortBy,
removeExt,

@@ -675,32 +676,2 @@ removeTrailingSlash,

export function multiSortBy<T>(
arr: Array<T>,
accessors: Array<(item: T) => any> = [(d) => d],
): Array<T> {
return arr
.map((d, i) => [d, i] as const)
.sort(([a, ai], [b, bi]) => {
for (const accessor of accessors) {
const ao = accessor(a)
const bo = accessor(b)
if (typeof ao === 'undefined') {
if (typeof bo === 'undefined') {
continue
}
return 1
}
if (ao === bo) {
continue
}
return ao > bo ? 1 : -1
}
return ai - bi
})
.map(([d]) => d)
}
function removeTrailingUnderscores(s?: string) {

@@ -707,0 +678,0 @@ return s?.replaceAll(/(_$)/gi, '').replaceAll(/(_\/)/gi, '/')

@@ -0,1 +1,31 @@

export function multiSortBy<T>(
arr: Array<T>,
accessors: Array<(item: T) => any> = [(d) => d],
): Array<T> {
return arr
.map((d, i) => [d, i] as const)
.sort(([a, ai], [b, bi]) => {
for (const accessor of accessors) {
const ao = accessor(a)
const bo = accessor(b)
if (typeof ao === 'undefined') {
if (typeof bo === 'undefined') {
continue
}
return 1
}
if (ao === bo) {
continue
}
return ao > bo ? 1 : -1
}
return ai - bi
})
.map(([d]) => d)
}
export function cleanPath(path: string) {

@@ -2,0 +32,0 @@ // remove double slashes

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 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