UNPKG

on-codemerge

Version:

A WYSIWYG editor for on-codemerge is a user-friendly interface that allows users to edit and view their code in real time, exactly as it will appear in the final product

9 lines (8 loc) 321 B
function n(t) { t.firstChild || t.appendChild(document.createTextNode("")); const a = document.createRange(), e = window.getSelection(); a.selectNodeContents(t), a.collapse(!0), e == null || e.removeAllRanges(), e == null || e.addRange(a), t instanceof HTMLElement && t.focus(); } export { n as focusNodeStart };