Update filters and sorting.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import firstBy from 'thenby';
|
||||
import { BROWSERS } from './constants';
|
||||
import { removeTrailingSlash, removeWWW, getDomainName } from './url';
|
||||
|
||||
@@ -43,9 +42,7 @@ export const urlFilter = (data, { raw }) => {
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
return Object.keys(map)
|
||||
.map(key => ({ x: key, y: map[key] }))
|
||||
.sort(firstBy('y', -1).thenBy('x'));
|
||||
return Object.keys(map).map(key => ({ x: key, y: map[key] }));
|
||||
};
|
||||
|
||||
export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
@@ -70,7 +67,7 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
}
|
||||
|
||||
if (domainOnly && hostname) {
|
||||
return hostname;
|
||||
return removeWWW(hostname);
|
||||
}
|
||||
|
||||
if (!origin || origin === 'null') {
|
||||
@@ -113,9 +110,7 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
||||
return obj;
|
||||
}, {});
|
||||
|
||||
return Object.keys(map)
|
||||
.map(key => ({ x: key, y: map[key], w: links[key] }))
|
||||
.sort(firstBy('y', -1).thenBy('x'));
|
||||
return Object.keys(map).map(key => ({ x: key, y: map[key], w: links[key] }));
|
||||
};
|
||||
|
||||
export const browserFilter = data =>
|
||||
|
||||
Reference in New Issue
Block a user