/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
client
/
components
/
router-reducer
/
reducers
/
/opt/canhelp/node_modules/next/dist/client/components/router-reducer/reducers
mkdir
upload
Name
Size
Mode
Actions
find-head-in-cache.d.ts
302
0644
edit
dl
rm
find-head-in-cache.js
2597
0644
edit
dl
rm
find-head-in-cache.js.map
3726
0644
edit
dl
rm
get-segment-value.d.ts
135
0644
edit
dl
rm
get-segment-value.js
685
0644
edit
dl
rm
get-segment-value.js.map
508
0644
edit
dl
rm
has-interception-route-in-current-tree.d.ts
193
0644
edit
dl
rm
has-interception-route-in-current-tree.js
1531
0644
edit
dl
rm
has-interception-route-in-current-tree.js.map
1682
0644
edit
dl
rm
hmr-refresh-reducer.d.ts
292
0644
edit
dl
rm
hmr-refresh-reducer.js
4738
0644
edit
dl
rm
hmr-refresh-reducer.js.map
7091
0644
edit
dl
rm
navigate-reducer.d.ts
577
0644
edit
dl
rm
navigate-reducer.js
21514
0644
edit
dl
rm
navigate-reducer.js.map
29928
0644
edit
dl
rm
prefetch-reducer.d.ts
508
0644
edit
dl
rm
prefetch-reducer.js
2015
0644
edit
dl
rm
prefetch-reducer.js.map
2338
0644
edit
dl
rm
refresh-reducer.d.ts
204
0644
edit
dl
rm
refresh-reducer.js
5594
0644
edit
dl
rm
refresh-reducer.js.map
8241
0644
edit
dl
rm
restore-reducer.d.ts
204
0644
edit
dl
rm
restore-reducer.js
2589
0644
edit
dl
rm
restore-reducer.js.map
3288
0644
edit
dl
rm
server-action-reducer.d.ts
229
0644
edit
dl
rm
server-action-reducer.js
15244
0644
edit
dl
rm
server-action-reducer.js.map
23369
0644
edit
dl
rm
server-patch-reducer.d.ts
216
0644
edit
dl
rm
server-patch-reducer.js
3422
0644
edit
dl
rm
server-patch-reducer.js.map
4802
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js
(2589B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "restoreReducer", { enumerable: true, get: function() { return restoreReducer; } }); const _createhreffromurl = require("../create-href-from-url"); const _computechangedpath = require("../compute-changed-path"); const _pprnavigations = require("../ppr-navigations"); function restoreReducer(state, action) { const { url, tree } = action; const href = (0, _createhreffromurl.createHrefFromUrl)(url); // This action is used to restore the router state from the history state. // However, it's possible that the history state no longer contains the `FlightRouterState`. // We will copy over the internal state on pushState/replaceState events, but if a history entry // occurred before hydration, or if the user navigated to a hash using a regular anchor link, // the history state will not contain the `FlightRouterState`. // In this case, we'll continue to use the existing tree so the router doesn't get into an invalid state. const treeToRestore = tree || state.tree; const oldCache = state.cache; const newCache = process.env.__NEXT_PPR ? // data for any segment whose dynamic data was already received. This // prevents an unnecessary flash back to PPR state during a // back/forward navigation. (0, _pprnavigations.updateCacheNodeOnPopstateRestoration)(oldCache, treeToRestore) : oldCache; var _extractPathFromFlightRouterState; return { // Set canonical url canonicalUrl: href, pushRef: { pendingPush: false, mpaNavigation: false, // Ensures that the custom history state that was set is preserved when applying this update. preserveCustomHistoryState: true }, focusAndScrollRef: state.focusAndScrollRef, cache: newCache, prefetchCache: state.prefetchCache, // Restore provided tree tree: treeToRestore, nextUrl: (_extractPathFromFlightRouterState = (0, _computechangedpath.extractPathFromFlightRouterState)(treeToRestore)) != null ? _extractPathFromFlightRouterState : url.pathname }; } if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=restore-reducer.js.map
Save
cmd:
run