function markAndMeasure ( childNodes , measureFn ) { const dimens = new Map ( ) ; childNodes . forEach ( ( child , index ) => { if ( child instanceof HTMLElement ) { const key = `.${ index }` ; child . dataset . layoutKey = key ; dimens . set ( key , measureFn ( child ) ) ; } } ) ; return dimens ; } function ifMarkedThenMeasure ( childNodes , measureFn ) { const dimens = new Map ( ) ; childNodes . forEach ( child => { if ( child instanceof HTMLElement ) { const key = child . dataset . layoutKey ; if ( key ) { dimens . set ( key , measureFn ( child ) ) ; } } } ) ; return dimens ; } export { markAndMeasure , ifMarkedThenMeasure } ;