@@ -143,9 +143,9 @@ function ignoreFirstCall(func: Function) {
143143function removeAbsoluteAlign (
144144 alignment : RectangleAlignment
145145) : RectangleAlignment {
146- return ( alignment . map (
146+ return alignment . map (
147147 ( a ) => a . replace ( / - a b s o l u t e $ / , '' ) as Align
148- ) as unknown ) as RectangleAlignment ;
148+ ) as unknown as RectangleAlignment ;
149149}
150150
151151export type AutoAlignOptions = {
@@ -287,12 +287,8 @@ export function autoAlign(options: AutoAlignOptions) {
287287 // eslint-disable-next-line react/destructuring-assignment
288288 const oldTriggerNodeRect = this . state . triggerNodeRect ;
289289 if ( triggerEl ) {
290- const {
291- top,
292- left,
293- width,
294- height,
295- } = triggerEl . getBoundingClientRect ( ) ;
290+ const { top, left, width, height } =
291+ triggerEl . getBoundingClientRect ( ) ;
296292 if (
297293 ! isEqualRect ( oldTriggerNodeRect , { top, left, width, height } )
298294 ) {
@@ -307,10 +303,8 @@ export function autoAlign(options: AutoAlignOptions) {
307303 } ;
308304
309305 updateAlignment = ( triggerNodeRect : Rect = EMPTY_RECT ) => {
310- const {
311- triggerNodeRect : oldTriggerNodeRect ,
312- alignment : oldAlignment ,
313- } = this . state ;
306+ const { triggerNodeRect : oldTriggerNodeRect , alignment : oldAlignment } =
307+ this . state ;
314308 const rootNodeRect = this . node
315309 ? this . node . getBoundingClientRect ( )
316310 : EMPTY_RECT ;
@@ -355,10 +349,8 @@ export function autoAlign(options: AutoAlignOptions) {
355349 } ;
356350
357351 render ( ) {
358- const {
359- triggerNodeRect = EMPTY_RECT ,
360- rootNodeRect = EMPTY_RECT ,
361- } = this . state ;
352+ const { triggerNodeRect = EMPTY_RECT , rootNodeRect = EMPTY_RECT } =
353+ this . state ;
362354 const {
363355 // eslint-disable-next-line react/destructuring-assignment
364356 alignment = this . state . alignment ,
@@ -387,7 +379,7 @@ export function autoAlign(options: AutoAlignOptions) {
387379 < Cmp
388380 alignment = { removeAbsoluteAlign ( alignment ) }
389381 ref = { ( cmp : any ) => ( this . content = cmp ) }
390- { ...pprops as TOriginalProps }
382+ { ...( pprops as TOriginalProps ) }
391383 >
392384 { children }
393385 </ Cmp >
0 commit comments