Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit c461aed

Browse files
authored
Revert "update page defaults search method"
1 parent 7d39cbb commit c461aed

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

lib/pageDefaults.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function pageDefaults() {
2020
return {
2121
path: canonicalPath(),
2222
referrer: document.referrer,
23-
search: searchPath(),
23+
search: location.search,
2424
title: document.title,
2525
url: canonicalUrl(location.search)
2626
};
@@ -55,21 +55,6 @@ function canonicalUrl(search) {
5555
return i === -1 ? url : url.slice(0, i);
5656
}
5757

58-
/**
59-
* Return the search path for the page
60-
* This is preferable to window.location.search because SPAs
61-
* can have a # in the url which will include the query param in
62-
* the hash
63-
*
64-
* @return {string}
65-
*/
66-
67-
function searchPath() {
68-
var url = window.location.href;
69-
var u = url.indexOf('?');
70-
return u === -1 ? '' : url.slice(u, -1);
71-
}
72-
7358
/*
7459
* Exports.
7560
*/

0 commit comments

Comments
 (0)