Initial commit
This commit is contained in:
9
node_modules/node-fetch/src/utils/get-search.js
generated
vendored
Normal file
9
node_modules/node-fetch/src/utils/get-search.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export const getSearch = parsedURL => {
|
||||
if (parsedURL.search) {
|
||||
return parsedURL.search;
|
||||
}
|
||||
|
||||
const lastOffset = parsedURL.href.length - 1;
|
||||
const hash = parsedURL.hash || (parsedURL.href[lastOffset] === '#' ? '#' : '');
|
||||
return parsedURL.href[lastOffset - hash.length] === '?' ? '?' : '';
|
||||
};
|
||||
Reference in New Issue
Block a user