@tanstack/react-router 0.0.1-beta.257 → 0.0.1-beta.258

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,9 @@
14
14
 
15
15
  function redirect(opts) {
16
16
  opts.isRedirect = true;
17
+ if (opts.throw) {
18
+ throw opts;
19
+ }
17
20
  return opts;
18
21
  }
19
22
  function isRedirect(obj) {
@@ -1 +1 @@
1
- {"version":3,"file":"redirects.js","sources":["../../src/redirects.ts"],"sourcesContent":["import { NavigateOptions } from './link'\nimport { AnyRoute } from './route'\nimport { RoutePaths } from './routeInfo'\nimport { RegisteredRouter } from './router'\n\n// Detect if we're in the DOM\n\nexport type AnyRedirect = Redirect<any, any, any>\n\nexport type Redirect<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = TFrom,\n TMaskTo extends string = '',\n> = NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & {\n code?: number\n}\n\nexport function redirect<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n>(opts: Redirect<TRouteTree, TFrom, TTo>): Redirect<TRouteTree, TFrom, TTo> {\n ;(opts as any).isRedirect = true\n return opts\n}\n\nexport function isRedirect(obj: any): obj is AnyRedirect {\n return !!obj?.isRedirect\n}\n"],"names":["redirect","opts","isRedirect","obj"],"mappings":";;;;;;;;;;;;AAKA;;AAcO,SAASA,QAAQA,CAItBC,IAAsC,EAAoC;EACxEA,IAAI,CAASC,UAAU,GAAG,IAAI,CAAA;AAChC,EAAA,OAAOD,IAAI,CAAA;AACb,CAAA;AAEO,SAASC,UAAUA,CAACC,GAAQ,EAAsB;AACvD,EAAA,OAAO,CAAC,CAACA,GAAG,EAAED,UAAU,CAAA;AAC1B;;;;;"}
1
+ {"version":3,"file":"redirects.js","sources":["../../src/redirects.ts"],"sourcesContent":["import { NavigateOptions } from './link'\nimport { AnyRoute } from './route'\nimport { RoutePaths } from './routeInfo'\nimport { RegisteredRouter } from './router'\n\n// Detect if we're in the DOM\n\nexport type AnyRedirect = Redirect<any, any, any>\n\nexport type Redirect<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = TFrom,\n TMaskTo extends string = '',\n> = {\n code?: number\n throw?: any\n} & NavigateOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>\n\nexport function redirect<\n TRouteTree extends AnyRoute = RegisteredRouter['routeTree'],\n TFrom extends RoutePaths<TRouteTree> = '/',\n TTo extends string = '',\n TMaskFrom extends RoutePaths<TRouteTree> = TFrom,\n TMaskTo extends string = '',\n>(\n opts: Redirect<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo>,\n): Redirect<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> {\n ;(opts as any).isRedirect = true\n if (opts.throw) {\n throw opts\n }\n return opts\n}\n\nexport function isRedirect(obj: any): obj is AnyRedirect {\n return !!obj?.isRedirect\n}\n"],"names":["redirect","opts","isRedirect","throw","obj"],"mappings":";;;;;;;;;;;;AAKA;;AAeO,SAASA,QAAQA,CAOtBC,IAA0D,EACJ;EACpDA,IAAI,CAASC,UAAU,GAAG,IAAI,CAAA;EAChC,IAAID,IAAI,CAACE,KAAK,EAAE;AACd,IAAA,MAAMF,IAAI,CAAA;AACZ,GAAA;AACA,EAAA,OAAOA,IAAI,CAAA;AACb,CAAA;AAEO,SAASC,UAAUA,CAACE,GAAQ,EAAsB;AACvD,EAAA,OAAO,CAAC,CAACA,GAAG,EAAEF,UAAU,CAAA;AAC1B;;;;;"}
@@ -1186,6 +1186,9 @@ function decode(str) {
1186
1186
 
1187
1187
  function redirect(opts) {
1188
1188
  opts.isRedirect = true;
1189
+ if (opts.throw) {
1190
+ throw opts;
1191
+ }
1189
1192
  return opts;
1190
1193
  }
1191
1194
  function isRedirect(obj) {