/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
esm
/
client
/
components
/
router-reducer
/
/opt/canhelp/node_modules/next/dist/esm/client/components/router-reducer
mkdir
upload
Name
Size
Mode
Actions
reducers/
-
0755
rm
aliased-prefetch-navigations.js
9255
0644
edit
dl
rm
aliased-prefetch-navigations.js.map
14795
0644
edit
dl
rm
apply-flight-data.js
1900
0644
edit
dl
rm
apply-flight-data.js.map
3438
0644
edit
dl
rm
apply-router-state-patch-to-tree.js
3777
0644
edit
dl
rm
apply-router-state-patch-to-tree.js.map
6533
0644
edit
dl
rm
clear-cache-node-data-for-segment-path.js
2888
0644
edit
dl
rm
clear-cache-node-data-for-segment-path.js.map
4754
0644
edit
dl
rm
compute-changed-path.js
4640
0644
edit
dl
rm
compute-changed-path.js.map
8380
0644
edit
dl
rm
create-href-from-url.js
227
0644
edit
dl
rm
create-href-from-url.js.map
584
0644
edit
dl
rm
create-initial-router-state.js
5731
0644
edit
dl
rm
create-initial-router-state.js.map
9232
0644
edit
dl
rm
create-router-cache-key.js
840
0644
edit
dl
rm
create-router-cache-key.js.map
1423
0644
edit
dl
rm
fetch-server-response.js
13838
0644
edit
dl
rm
fetch-server-response.js.map
23503
0644
edit
dl
rm
fill-cache-with-new-subtree-data.js
4453
0644
edit
dl
rm
fill-cache-with-new-subtree-data.js.map
8376
0644
edit
dl
rm
fill-lazy-items-till-leaf-with-head.js
6857
0644
edit
dl
rm
fill-lazy-items-till-leaf-with-head.js.map
9804
0644
edit
dl
rm
handle-mutable.js
2887
0644
edit
dl
rm
handle-mutable.js.map
5381
0644
edit
dl
rm
handle-segment-mismatch.js
867
0644
edit
dl
rm
handle-segment-mismatch.js.map
1810
0644
edit
dl
rm
invalidate-cache-below-flight-segmentpath.js
2255
0644
edit
dl
rm
invalidate-cache-below-flight-segmentpath.js.map
3929
0644
edit
dl
rm
invalidate-cache-by-router-state.js
902
0644
edit
dl
rm
invalidate-cache-by-router-state.js.map
1870
0644
edit
dl
rm
is-navigating-to-new-root-layout.js
1913
0644
edit
dl
rm
is-navigating-to-new-root-layout.js.map
3104
0644
edit
dl
rm
ppr-navigations.js
45642
0644
edit
dl
rm
ppr-navigations.js.map
71127
0644
edit
dl
rm
prefetch-cache-utils.js
14732
0644
edit
dl
rm
prefetch-cache-utils.js.map
22724
0644
edit
dl
rm
refetch-inactive-parallel-segments.js
5163
0644
edit
dl
rm
refetch-inactive-parallel-segments.js.map
7937
0644
edit
dl
rm
router-reducer-types.js
1322
0644
edit
dl
rm
router-reducer-types.js.map
9732
0644
edit
dl
rm
router-reducer.js
2159
0644
edit
dl
rm
router-reducer.js.map
3451
0644
edit
dl
rm
set-cache-busting-search-param.js
3279
0644
edit
dl
rm
set-cache-busting-search-param.js.map
4848
0644
edit
dl
rm
should-hard-navigate.js
1133
0644
edit
dl
rm
should-hard-navigate.js.map
2111
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/esm/client/components/router-reducer/handle-mutable.js
(2887B)
import { computeChangedPath } from './compute-changed-path'; function isNotUndefined(value) { return typeof value !== 'undefined'; } export function handleMutable(state, mutable) { var _mutable_shouldScroll; // shouldScroll is true by default, can override to false. const shouldScroll = (_mutable_shouldScroll = mutable.shouldScroll) != null ? _mutable_shouldScroll : true; let nextUrl = state.nextUrl; if (isNotUndefined(mutable.patchedTree)) { // If we received a patched tree, we need to compute the changed path. const changedPath = computeChangedPath(state.tree, mutable.patchedTree); if (changedPath) { // If the tree changed, we need to update the nextUrl nextUrl = changedPath; } else if (!nextUrl) { // if the tree ends up being the same (ie, no changed path), and we don't have a nextUrl, then we should use the canonicalUrl nextUrl = state.canonicalUrl; } // otherwise this will be a no-op and continue to use the existing nextUrl } var _mutable_scrollableSegments; return { // Set href. canonicalUrl: isNotUndefined(mutable.canonicalUrl) ? mutable.canonicalUrl === state.canonicalUrl ? state.canonicalUrl : mutable.canonicalUrl : state.canonicalUrl, pushRef: { pendingPush: isNotUndefined(mutable.pendingPush) ? mutable.pendingPush : state.pushRef.pendingPush, mpaNavigation: isNotUndefined(mutable.mpaNavigation) ? mutable.mpaNavigation : state.pushRef.mpaNavigation, preserveCustomHistoryState: isNotUndefined(mutable.preserveCustomHistoryState) ? mutable.preserveCustomHistoryState : state.pushRef.preserveCustomHistoryState }, // All navigation requires scroll and focus management to trigger. focusAndScrollRef: { apply: shouldScroll ? isNotUndefined(mutable == null ? void 0 : mutable.scrollableSegments) ? true : state.focusAndScrollRef.apply : false, onlyHashChange: mutable.onlyHashChange || false, hashFragment: shouldScroll ? // #top is handled in layout-router. mutable.hashFragment && mutable.hashFragment !== '' ? decodeURIComponent(mutable.hashFragment.slice(1)) : state.focusAndScrollRef.hashFragment : null, segmentPaths: shouldScroll ? (_mutable_scrollableSegments = mutable == null ? void 0 : mutable.scrollableSegments) != null ? _mutable_scrollableSegments : state.focusAndScrollRef.segmentPaths : [] }, // Apply cache. cache: mutable.cache ? mutable.cache : state.cache, prefetchCache: mutable.prefetchCache ? mutable.prefetchCache : state.prefetchCache, // Apply patched router state. tree: isNotUndefined(mutable.patchedTree) ? mutable.patchedTree : state.tree, nextUrl }; } //# sourceMappingURL=handle-mutable.js.map
Save
cmd:
run