Convert some instances (filter, find, pick) to native from lodash

This commit is contained in:
Qstick
2020-09-27 22:33:21 -04:00
parent 987ed357d5
commit d8a0aac9c3
21 changed files with 69 additions and 94 deletions

View File

@@ -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);