w/resources/src/mediawiki/mediawiki.String.js
// Like String#charAt, but return the pair of UTF-16 surrogates for characters outside of BMP.
Like String#charAt, but return the pair of UTF-16 surrogates for characters outside of BMP.
Like String#charAt but return the pair of UTF - 16 surrogates for characters outside of BMP .
function codePointAt( string, offset, backwards ) {
		var maybePair = backwards ?
			string.slice( offset - 1, offset + 1 ) :
			string.slice( offset, offset + 2 );
		if ( /^[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test( maybePair ) ) {
			return maybePair;
		} else {
			return string.charAt( offset );
		}
	}
function codePointAt ( string , offset , backwards ) { var maybePair = backwards ? string . slice ( offset - 1 , offset + 1 ) : string . slice ( offset , offset + 2 ) ; if ( / ^[\uD800-\uDBFF][\uDC00-\uDFFF]$ / . test ( maybePair ) ) { return maybePair ; } else { return string . charAt ( offset ) ; } }
Like String#charAt, but return the pair of UTF-16 surrogates for characters outside of BMP.
Like String#charAt but return the pair of UTF - 16 surrogates for characters outside of BMP .
// We don't need to check for offsets at the beginning or end of string, // String#slice will simply return a shorter (or empty) substring.