Skip to content

Commit

Permalink
Lodash: Refactor away from _.lowerCase() (WordPress#41982)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla authored Jun 28, 2022
1 parent e86e801 commit cd47e95
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module.exports = {
'isObjectLike',
'isUndefined',
'keys',
'lowerCase',
'memoize',
'negate',
'noop',
Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/mobile/link-picker/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { SafeAreaView, TouchableOpacity, View } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import { lowerCase, startsWith } from 'lodash';

/**
* WordPress dependencies
Expand All @@ -26,7 +25,7 @@ import styles from './styles.scss';
export const createDirectEntry = ( value ) => {
let type = 'URL';

const protocol = lowerCase( getProtocol( value ) ) || '';
const protocol = getProtocol( value )?.toLowerCase() || '';

if ( protocol.includes( 'mailto' ) ) {
type = 'mailto';
Expand All @@ -36,7 +35,7 @@ export const createDirectEntry = ( value ) => {
type = 'tel';
}

if ( startsWith( value, '#' ) ) {
if ( value?.startsWith( '#' ) ) {
type = 'internal';
}

Expand Down

0 comments on commit cd47e95

Please sign in to comment.