35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
"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");
|
|
function restoreReducer(state, action) {
|
|
const { url, tree } = action;
|
|
const href = (0, _createhreffromurl.createHrefFromUrl)(url);
|
|
return {
|
|
buildId: state.buildId,
|
|
// Set canonical url
|
|
canonicalUrl: href,
|
|
pushRef: state.pushRef,
|
|
focusAndScrollRef: state.focusAndScrollRef,
|
|
cache: state.cache,
|
|
prefetchCache: state.prefetchCache,
|
|
// Restore provided tree
|
|
tree: tree,
|
|
nextUrl: 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 |