dist/dom-selection.es.js
function isBackwards(sel) {
	sel = sel || getSelection();
	if (isCollapsed(sel)) { return; }

	// Detect if selection is backwards
	var range = doc.createRange();
	range.setStart(sel.anchorNode, sel.anchorOffset);
	range.setEnd(sel.focusNode, sel.focusOffset);
	range.detach();

	// if `collapsed` then it's backwards
	return range.collapsed;
}
function isBackwards(sel) {
	sel = sel || getSelection();
	if (isCollapsed(sel)) { return; }

	// Detect if selection is backwards
	var range = doc.createRange();
	range.setStart(sel.anchorNode, sel.anchorOffset);
	range.setEnd(sel.focusNode, sel.focusOffset);
	range.detach();

	// if `collapsed` then it's backwards
	return range.collapsed;
}
function isBackwards ( sel ) { sel = sel || getSelection ( ) ; if ( isCollapsed ( sel ) ) { return ; } // Detect if selection is backwards var range = doc . createRange ( ) ; range . setStart ( sel . anchorNode , sel . anchorOffset ) ; range . setEnd ( sel . focusNode , sel . focusOffset ) ; range . detach ( ) ; // if `collapsed` then it's backwards return range . collapsed ; }
Detect the direction of the Selection
@param  {Selection} sel
@return {Boolean}
Detect the direction of the Selection