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 PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -17,8 +16,8 @@ function createMapStateToProps() {
schema
} = downloadClients;
const usenetDownloadClients = _.filter(schema, { protocol: 'usenet' });
const torrentDownloadClients = _.filter(schema, { protocol: 'torrent' });
const usenetDownloadClients = schema.filter({ protocol: 'usenet' });
const torrentDownloadClients = schema.filter({ protocol: 'torrent' });
return {
isSchemaFetching,

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -27,7 +26,7 @@ function createImportExclusionSelector() {
items
} = importExclusions;
const mapping = id ? _.find(items, { id }) : newImportExclusion;
const mapping = id ? items.find({ id }) : newImportExclusion;
const settings = selectSettings(mapping, pendingChanges, saveError);
return {

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -27,7 +26,7 @@ function createMapStateToProps() {
items
} = restrictions;
const profile = id ? _.find(items, { id }) : newRestriction;
const profile = id ? items.find({ id }) : newRestriction;
const settings = selectSettings(profile, pendingChanges, saveError);
return {

View File

@@ -1,4 +1,3 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
@@ -20,7 +19,7 @@ function createMapStateToProps() {
items
} = metadata;
const settings = selectSettings(_.find(items, { id }), pendingChanges, saveError);
const settings = selectSettings(items.find({ id }), pendingChanges, saveError);
return {
advancedSettings,