11/* eslint-disable no-use-before-define */
2- import { isEmpty , pickBy , omitBy , uniq , keys } from "lodash" ;
2+ import { isEmpty , pickBy , omitBy , uniq } from "lodash" ;
33import type { EventMixinCalculatedValues } from "./add-events" ;
44import { isFunction } from "./helpers" ;
55
@@ -157,12 +157,14 @@ export function getScopedEvents(
157157 }
158158 if ( eventReturn . eventKey === "all" ) {
159159 return newBaseProps [ childName ]
160- ? keys ( newBaseProps [ childName ] ) . filter ( ( value ) => value !== "parent" )
161- : keys ( newBaseProps ) . filter ( ( value ) => value !== "parent" ) ;
160+ ? Object . keys ( newBaseProps [ childName ] ) . filter (
161+ ( value ) => value !== "parent" ,
162+ )
163+ : Object . keys ( newBaseProps ) . filter ( ( value ) => value !== "parent" ) ;
162164 } else if ( eventReturn . eventKey === undefined && eventKey === "parent" ) {
163165 return newBaseProps [ childName ]
164- ? keys ( newBaseProps [ childName ] )
165- : keys ( newBaseProps ) ;
166+ ? Object . keys ( newBaseProps [ childName ] )
167+ : Object . keys ( newBaseProps ) ;
166168 }
167169 return eventReturn . eventKey !== undefined
168170 ? eventReturn . eventKey
@@ -194,7 +196,7 @@ export function getScopedEvents(
194196 if ( state [ key ] && state [ key ] [ target ] ) {
195197 delete state [ key ] [ target ] ;
196198 }
197- if ( state [ key ] && ! keys ( state [ key ] ) . length ) {
199+ if ( state [ key ] && ! Object . keys ( state [ key ] ) . length ) {
198200 delete state [ key ] ;
199201 }
200202 return state ;
@@ -234,7 +236,7 @@ export function getScopedEvents(
234236 // returns an entire mutated state for all children
235237 const allChildNames =
236238 childNames === "all"
237- ? keys ( newBaseProps ) . filter ( ( value ) => value !== "parent" )
239+ ? Object . keys ( newBaseProps ) . filter ( ( value ) => value !== "parent" )
238240 : childNames ;
239241 return Array . isArray ( allChildNames )
240242 ? allChildNames . reduce ( ( memo , childName ) => {
@@ -278,7 +280,7 @@ export function getScopedEvents(
278280 } ;
279281
280282 // returns a new events object with enhanced event handlers
281- return keys ( events ) . reduce ( ( memo , event ) => {
283+ return Object . keys ( events ) . reduce ( ( memo , event ) => {
282284 memo [ event ] = onEvent ;
283285 return memo ;
284286 } , { } ) ;
@@ -295,7 +297,7 @@ export function getPartialEvents(
295297) : PartialEvents {
296298 if ( ! events ) return { } ;
297299
298- return keys ( events ) . reduce ( ( memo , eventName ) => {
300+ return Object . keys ( events ) . reduce ( ( memo , eventName ) => {
299301 const appliedEvent = ( evt ) =>
300302 events [ eventName ] ( evt , childProps , eventKey , eventName ) ;
301303 memo [ eventName ] = appliedEvent ;
@@ -378,7 +380,7 @@ export function getExternalMutations(
378380 baseState = { } ,
379381 childName ?,
380382) {
381- const eventKeys = keys ( baseProps ) ;
383+ const eventKeys = Object . keys ( baseProps ) ;
382384 return eventKeys . reduce ( ( memo , eventKey ) => {
383385 const keyState = baseState [ eventKey ] || { } ;
384386 const keyProps = baseProps [ eventKey ] || { } ;
@@ -397,7 +399,7 @@ export function getExternalMutations(
397399 } else {
398400 // use keys from both state and props so that elements not intially included in baseProps
399401 // will be used. (i.e. labels)
400- const targets = uniq ( keys ( keyProps ) . concat ( keys ( keyState ) ) ) ;
402+ const targets = uniq ( Object . keys ( keyProps ) . concat ( Object . keys ( keyState ) ) ) ;
401403 memo [ eventKey ] = targets . reduce ( ( m , target ) => {
402404 const identifier = { eventKey, target, childName } ;
403405 const mutation = getExternalMutation (
0 commit comments