mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Convert some instances (filter, find, pick) to native from lodash
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import _ from 'lodash';
|
||||
import qs from 'qs';
|
||||
|
||||
// See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils
|
||||
@@ -10,18 +9,17 @@ export default function parseUrl(url) {
|
||||
// The `origin`, `password`, and `username` properties are unavailable in
|
||||
// Opera Presto. We synthesize `origin` if it's not present. While `password`
|
||||
// and `username` are ignored intentionally.
|
||||
const properties = _.pick(
|
||||
anchor,
|
||||
'hash',
|
||||
'host',
|
||||
'hostname',
|
||||
'href',
|
||||
'origin',
|
||||
'pathname',
|
||||
'port',
|
||||
'protocol',
|
||||
'search'
|
||||
);
|
||||
const properties = {
|
||||
hash: anchor.hash,
|
||||
host: anchor.host,
|
||||
hostname: anchor.hostname,
|
||||
href: anchor.href,
|
||||
origin: anchor.origin,
|
||||
pathname: anchor.pathname,
|
||||
port: anchor.port,
|
||||
protocol: anchor.protocol,
|
||||
search: anchor.search
|
||||
};
|
||||
|
||||
properties.isAbsolute = (/^[\w:]*\/\//).test(url);
|
||||
|
||||
|
Reference in New Issue
Block a user