Escapes a string
@param {lunr.Token} token The string to escape
@returns {lunr.Token} An escaped string
function escapeRegexString( token ) {
	// taken from: https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js
	const matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
	return token.update( str => str.replace( matchOperatorsRe, '\\$&' ) );
}