@tanstack/router-core 1.131.23 → 1.131.25

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.
@@ -62,7 +62,6 @@ exports.isModuleNotFoundError = utils.isModuleNotFoundError;
62
62
  exports.isPlainArray = utils.isPlainArray;
63
63
  exports.isPlainObject = utils.isPlainObject;
64
64
  exports.last = utils.last;
65
- exports.pick = utils.pick;
66
65
  exports.replaceEqualDeep = utils.replaceEqualDeep;
67
66
  exports.shallow = utils.shallow;
68
67
  exports.isRedirect = redirect.isRedirect;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -24,7 +24,7 @@ export { retainSearchParams, stripSearchParams } from './searchMiddleware.cjs';
24
24
  export { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, } from './searchParams.cjs';
25
25
  export type { SearchSerializer, SearchParser } from './searchParams.cjs';
26
26
  export type { OptionalStructuralSharing } from './structuralSharing.cjs';
27
- export { last, functionalUpdate, pick, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, escapeJSON, shallow, createControlledPromise, isModuleNotFoundError, } from './utils.cjs';
27
+ export { last, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, escapeJSON, shallow, createControlledPromise, isModuleNotFoundError, } from './utils.cjs';
28
28
  export type { NoInfer, IsAny, PickAsRequired, PickRequired, PickOptional, WithoutEmpty, Expand, DeepPartial, MakeDifferenceOptional, IsUnion, IsNonEmptyObject, Assign, IntersectAssign, Timeout, Updater, NonNullableUpdater, StringLiteral, ThrowOrOptional, ThrowConstraint, ControlledPromise, ExtractObjects, PartialMergeAllObject, MergeAllPrimitive, ExtractPrimitives, PartialMergeAll, Constrain, ConstrainLiteral, UnionToIntersection, MergeAllObjects, MergeAll, ValidateJSON, StrictOrFrom, LooseReturnType, LooseAsyncReturnType, Awaitable, } from './utils.cjs';
29
29
  export type { StandardSchemaValidatorProps, StandardSchemaValidator, AnyStandardSchemaValidator, StandardSchemaValidatorTypes, AnyStandardSchemaValidateSuccess, AnyStandardSchemaValidateFailure, AnyStandardSchemaValidateIssue, AnyStandardSchemaValidateInput, AnyStandardSchemaValidate, ValidatorObj, AnyValidatorObj, ValidatorAdapter, AnyValidatorAdapter, AnyValidatorFn, ValidatorFn, Validator, AnyValidator, AnySchema, DefaultValidator, ResolveSearchValidatorInputFn, ResolveSearchValidatorInput, ResolveValidatorInputFn, ResolveValidatorInput, ResolveValidatorOutputFn, ResolveValidatorOutput, } from './validators.cjs';
30
30
  export type { UseRouteContextBaseOptions, UseRouteContextOptions, UseRouteContextResult, } from './useRouteContext.cjs';
@@ -231,7 +231,7 @@ class RouterCore {
231
231
  };
232
232
  this.buildLocation = (opts) => {
233
233
  const build = (dest = {}) => {
234
- var _a;
234
+ var _a, _b;
235
235
  const currentLocation = dest._fromLocation || this.latestLocation;
236
236
  const allCurrentLocationMatches = this.matchRoutes(currentLocation, {
237
237
  _buildLocation: true
@@ -264,51 +264,51 @@ class RouterCore {
264
264
  const fromSearch = lastMatch.search;
265
265
  const fromParams = { ...lastMatch.params };
266
266
  const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(fromPath, ".");
267
- let nextParams = dest.params === false || dest.params === null ? {} : (dest.params ?? true) === true ? fromParams : {
268
- ...fromParams,
269
- ...utils.functionalUpdate(dest.params, fromParams)
270
- };
267
+ const nextParams = dest.params === false || dest.params === null ? {} : (dest.params ?? true) === true ? fromParams : Object.assign(
268
+ fromParams,
269
+ utils.functionalUpdate(dest.params, fromParams)
270
+ );
271
271
  const interpolatedNextTo = path.interpolatePath({
272
272
  path: nextTo,
273
- params: nextParams ?? {},
273
+ params: nextParams,
274
274
  parseCache: this.parsePathnameCache
275
275
  }).interpolatedPath;
276
276
  const destRoutes = this.matchRoutes(interpolatedNextTo, void 0, {
277
277
  _buildLocation: true
278
278
  }).map((d) => this.looseRoutesById[d.routeId]);
279
279
  if (Object.keys(nextParams).length > 0) {
280
- destRoutes.map((route) => {
281
- var _a2;
282
- return ((_a2 = route.options.params) == null ? void 0 : _a2.stringify) ?? route.options.stringifyParams;
283
- }).filter(Boolean).forEach((fn) => {
284
- nextParams = { ...nextParams, ...fn(nextParams) };
285
- });
280
+ for (const route of destRoutes) {
281
+ const fn = ((_a = route.options.params) == null ? void 0 : _a.stringify) ?? route.options.stringifyParams;
282
+ if (fn) {
283
+ Object.assign(nextParams, fn(nextParams));
284
+ }
285
+ }
286
286
  }
287
287
  const nextPathname = path.interpolatePath({
288
288
  // Use the original template path for interpolation
289
289
  // This preserves the original parameter syntax including optional parameters
290
290
  path: nextTo,
291
- params: nextParams ?? {},
291
+ params: nextParams,
292
292
  leaveWildcards: false,
293
293
  leaveParams: opts.leaveParams,
294
294
  decodeCharMap: this.pathParamsDecodeCharMap,
295
295
  parseCache: this.parsePathnameCache
296
296
  }).interpolatedPath;
297
297
  let nextSearch = fromSearch;
298
- if (opts._includeValidateSearch && ((_a = this.options.search) == null ? void 0 : _a.strict)) {
299
- let validatedSearch = {};
298
+ if (opts._includeValidateSearch && ((_b = this.options.search) == null ? void 0 : _b.strict)) {
299
+ const validatedSearch = {};
300
300
  destRoutes.forEach((route) => {
301
- try {
302
- if (route.options.validateSearch) {
303
- validatedSearch = {
304
- ...validatedSearch,
305
- ...validateSearch(route.options.validateSearch, {
301
+ if (route.options.validateSearch) {
302
+ try {
303
+ Object.assign(
304
+ validatedSearch,
305
+ validateSearch(route.options.validateSearch, {
306
306
  ...validatedSearch,
307
307
  ...nextSearch
308
- }) ?? {}
309
- };
308
+ })
309
+ );
310
+ } catch {
310
311
  }
311
- } catch {
312
312
  }
313
313
  });
314
314
  nextSearch = validatedSearch;
@@ -361,7 +361,7 @@ class RouterCore {
361
361
  if (foundMask) {
362
362
  const { from: _from, ...maskProps } = foundMask;
363
363
  maskedDest = {
364
- ...utils.pick(opts, ["from"]),
364
+ from: opts.from,
365
365
  ...maskProps,
366
366
  params
367
367
  };
@@ -376,7 +376,7 @@ class RouterCore {
376
376
  };
377
377
  if (opts.mask) {
378
378
  return buildWithMatches(opts, {
379
- ...utils.pick(opts, ["from"]),
379
+ from: opts.from,
380
380
  ...opts.mask
381
381
  });
382
382
  }