import { customAttr } from './constants' ; description param startContainer param noteContainer const getStartNode = ( startContainer , noteContainer ) : Element => { let node = startContainer ; let lastNode = startContainer ; while ( node && node !== noteContainer ) { const isCustom = node . getAttribute && node . getAttribute ( customAttr ) ; if ( isCustom ) { lastNode = node ; break ; } node = node . parentNode as Element ; } return lastNode ; } ; export default getStartNode ;