2
2
* External dependencies
3
3
*/
4
4
import createSelector from 'rememo' ;
5
- import { includes , some , values } from 'lodash' ;
6
5
7
6
/**
8
7
* WordPress dependencies
@@ -43,8 +42,7 @@ export const isEditorSidebarOpened = createRegistrySelector(
43
42
select ( interfaceStore ) . getActiveComplementaryArea (
44
43
'core/edit-post'
45
44
) ;
46
- return includes (
47
- [ 'edit-post/document' , 'edit-post/block' ] ,
45
+ return [ 'edit-post/document' , 'edit-post/block' ] . includes (
48
46
activeGeneralSidebar
49
47
) ;
50
48
}
@@ -65,8 +63,7 @@ export const isPluginSidebarOpened = createRegistrySelector(
65
63
) ;
66
64
return (
67
65
! ! activeGeneralSidebar &&
68
- ! includes (
69
- [ 'edit-post/document' , 'edit-post/block' ] ,
66
+ ! [ 'edit-post/document' , 'edit-post/block' ] . includes (
70
67
activeGeneralSidebar
71
68
)
72
69
) ;
@@ -254,7 +251,7 @@ export function isPublishSidebarOpened( state ) {
254
251
* @return {boolean } Whether or not the panel is removed.
255
252
*/
256
253
export function isEditorPanelRemoved ( state , panelName ) {
257
- return includes ( state . removedPanels , panelName ) ;
254
+ return state . removedPanels . includes ( panelName ) ;
258
255
}
259
256
260
257
/**
@@ -369,7 +366,7 @@ export const getActiveMetaBoxLocations = createSelector(
369
366
export function isMetaBoxLocationVisible ( state , location ) {
370
367
return (
371
368
isMetaBoxLocationActive ( state , location ) &&
372
- some ( getMetaBoxesPerLocation ( state , location ) , ( { id } ) => {
369
+ getMetaBoxesPerLocation ( state , location ) ?. some ( ( { id } ) => {
373
370
return isEditorPanelEnabled ( state , `meta-box-${ id } ` ) ;
374
371
} )
375
372
) ;
@@ -410,7 +407,7 @@ export function getMetaBoxesPerLocation( state, location ) {
410
407
*/
411
408
export const getAllMetaBoxes = createSelector (
412
409
( state ) => {
413
- return values ( state . metaBoxes . locations ) . flat ( ) ;
410
+ return Object . values ( state . metaBoxes . locations ) . flat ( ) ;
414
411
} ,
415
412
( state ) => [ state . metaBoxes . locations ]
416
413
) ;
0 commit comments