samples/cordova/text_chat/www/libs/stickerpipe/js/stickerpipe.js
function grabTheRightIcon(icon, variant) {
			// if variant is present as \uFE0F
			return toCodePoint(
				variant === '\uFE0F' ?
					// the icon should not contain it
					icon.slice(0, -1) :
					// fix non standard OSX behavior
					(icon.length === 3 && icon.charAt(1) === '\uFE0F' ?
					icon.charAt(0) + icon.charAt(2) : icon)
			);
		}
function grabTheRightIcon(icon, variant) {
			// if variant is present as \uFE0F
			return toCodePoint(
				variant === '\uFE0F' ?
					// the icon should not contain it
					icon.slice(0, -1) :
					// fix non standard OSX behavior
					(icon.length === 3 && icon.charAt(1) === '\uFE0F' ?
					icon.charAt(0) + icon.charAt(2) : icon)
			);
		}
function grabTheRightIcon ( icon , variant ) { // if variant is present as \uFE0F return toCodePoint ( variant === '\uFE0F' ? // the icon should not contain it icon . slice ( 0 , - 1 ) : // fix non standard OSX behavior ( icon . length === 3 && icon . charAt ( 1 ) === '\uFE0F' ? icon . charAt ( 0 ) + icon . charAt ( 2 ) : icon ) ) ; }
Used to both remove the possible variant
and to convert utf16 into code points
@param   string    the emoji surrogate pair
@param   string    the optional variant char, if any
Used to both remove the possible variant and to convert utf16 into code points