commit
ae354ba676
|
@ -50,13 +50,15 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||||
const links = {};
|
const links = {};
|
||||||
|
|
||||||
const isValidRef = referrer => {
|
const isValidRef = referrer => {
|
||||||
return (
|
return referrer !== null && !referrer.startsWith('/') && !referrer.startsWith('#');
|
||||||
referrer !== '' && referrer !== null && !referrer.startsWith('/') && !referrer.startsWith('#')
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const cleanUrl = url => {
|
const cleanUrl = url => {
|
||||||
try {
|
try {
|
||||||
|
if (url === '') {
|
||||||
|
return 'Direct / None';
|
||||||
|
}
|
||||||
|
|
||||||
const { hostname, origin, pathname, searchParams, protocol } = new URL(url);
|
const { hostname, origin, pathname, searchParams, protocol } = new URL(url);
|
||||||
|
|
||||||
if (regex.test(url)) {
|
if (regex.test(url)) {
|
||||||
|
|
Loading…
Reference in New Issue