/opt/canhelp/node_modules/next/dist/client/components/router-reducer/reducers
NameSizeModeActions
find-head-in-cache.d.ts3020644editdlrm
find-head-in-cache.js25970644editdlrm
find-head-in-cache.js.map37260644editdlrm
get-segment-value.d.ts1350644editdlrm
get-segment-value.js6850644editdlrm
get-segment-value.js.map5080644editdlrm
has-interception-route-in-current-tree.d.ts1930644editdlrm
has-interception-route-in-current-tree.js15310644editdlrm
has-interception-route-in-current-tree.js.map16820644editdlrm
hmr-refresh-reducer.d.ts2920644editdlrm
hmr-refresh-reducer.js47380644editdlrm
hmr-refresh-reducer.js.map70910644editdlrm
navigate-reducer.d.ts5770644editdlrm
navigate-reducer.js215140644editdlrm
navigate-reducer.js.map299280644editdlrm
prefetch-reducer.d.ts5080644editdlrm
prefetch-reducer.js20150644editdlrm
prefetch-reducer.js.map23380644editdlrm
refresh-reducer.d.ts2040644editdlrm
refresh-reducer.js55940644editdlrm
refresh-reducer.js.map82410644editdlrm
restore-reducer.d.ts2040644editdlrm
restore-reducer.js25890644editdlrm
restore-reducer.js.map32880644editdlrm
server-action-reducer.d.ts2290644editdlrm
server-action-reducer.js152440644editdlrm
server-action-reducer.js.map233690644editdlrm
server-patch-reducer.d.ts2160644editdlrm
server-patch-reducer.js34220644editdlrm
server-patch-reducer.js.map48020644editdlrm
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