MCPcopy
hub / github.com/TanStack/router / createDynamicNode

Function createDynamicNode

packages/router-core/src/new-process-route-tree.ts:537–567  ·  view source on GitHub ↗

* Keys must be declared in the same order as in `SegmentNode` type, * to ensure they are represented as the same object class in the engine.

(
  kind:
    | typeof SEGMENT_TYPE_PARAM
    | typeof SEGMENT_TYPE_WILDCARD
    | typeof SEGMENT_TYPE_OPTIONAL_PARAM,
  fullPath: string,
  caseSensitive: boolean,
  prefix?: string,
  suffix?: string,
)

Source from the content-addressed store, hash-verified

535 * to ensure they are represented as the same object class in the engine.
536 */
537function createDynamicNode<T extends RouteLike>(
538 kind:
539 | typeof SEGMENT_TYPE_PARAM
540 | typeof SEGMENT_TYPE_WILDCARD
541 | typeof SEGMENT_TYPE_OPTIONAL_PARAM,
542 fullPath: string,
543 caseSensitive: boolean,
544 prefix?: string,
545 suffix?: string,
546): DynamicSegmentNode<T> {
547 return {
548 kind,
549 depth: 0,
550 pathless: null,
551 index: null,
552 static: null,
553 staticInsensitive: null,
554 dynamic: null,
555 optional: null,
556 wildcard: null,
557 route: null,
558 fullPath,
559 parent: null,
560 parse: null,
561 skipOnParamError: false,
562 parsingPriority: 0,
563 caseSensitive,
564 prefix,
565 suffix,
566 }
567}
568
569type StaticSegmentNode<T extends RouteLike> = SegmentNode<T> & {
570 kind:

Callers 1

parseSegmentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected