11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3- import _ from 'lodash' ;
3+ import get from 'lodash/get' ;
4+ import filter from 'lodash/filter' ;
5+ import size from 'lodash/size' ;
6+ import uniqBy from 'lodash/uniqBy' ;
47import Module from '../../Module' ;
58
69import classes from './style.scss' ;
@@ -19,27 +22,27 @@ export default class Maintainers extends React.Component {
1922 }
2023
2124 get author ( ) {
22- return _ . get ( this , 'props.packageMeta.latest.author' ) ;
25+ return get ( this , 'props.packageMeta.latest.author' ) ;
2326 }
2427
2528 get contributors ( ) {
26- let contributors = _ . get ( this , 'props.packageMeta.latest.contributors' , { } ) ;
27- return _ . filter ( contributors , ( contributor ) => {
29+ let contributors = get ( this , 'props.packageMeta.latest.contributors' , { } ) ;
30+ return filter ( contributors , ( contributor ) => {
2831 return (
29- contributor . name !== _ . get ( this , 'author.name' ) &&
30- contributor . email !== _ . get ( this , 'author.email' )
32+ contributor . name !== get ( this , 'author.name' ) &&
33+ contributor . email !== get ( this , 'author.email' )
3134 ) ;
3235 } ) ;
3336 }
3437
3538 get showAllContributors ( ) {
36- return this . state . showAllContributors || _ . size ( this . contributors ) <= 5 ;
39+ return this . state . showAllContributors || size ( this . contributors ) <= 5 ;
3740 }
3841
3942 get uniqueContributors ( ) {
4043 if ( ! this . contributors ) return [ ] ;
4144
42- return _ . uniqBy ( this . contributors , ( contributor ) => contributor . name ) . slice ( 0 , 5 ) ;
45+ return uniqBy ( this . contributors , ( contributor ) => contributor . name ) . slice ( 0 , 5 ) ;
4346 }
4447
4548 handleShowAllContributors ( ) {
0 commit comments