src/index.js
/**
 * Lowercases string inputs and removes non-string or number characters
 * @param {string} text The string to be cleaned
 * @return {string} The cleaned string
 */
Lowercases string inputs and removes non-string or number characters
@param {string} text The string to be cleaned
@return {string} The cleaned string
Lowercases string inputs and removes non - string or number characters @param { string } text The string to be cleaned @return { string } The cleaned string
function toId(text) {
	if (text && text.id) {
		text = text.id;
	} else if (text && text.userid) {
		text = text.userid;
	}
	if (typeof text !== 'string' && typeof text !== 'number') return '';
	return ('' + text).toLowerCase().replace(/[^a-z0-9]+/g, '');
}
function toId ( text ) { if ( text && text . id ) { text = text . id ; } else if ( text && text . userid ) { text = text . userid ; } if ( typeof text !== 'string' && typeof text !== 'number' ) return '' ; return ( '' + text ) . toLowerCase ( ) . replace ( / [^a-z0-9]+ / g , '' ) ; }
Lowercases string inputs and removes non-string or number characters
 @param {string} text The string to be cleaned
 @return {string} The cleaned string
Lowercases string inputs and removes non - string or number characters @param { string } text The string to be cleaned @return { string } The cleaned string