function correctTypedef( typedef ) {
		var diff;
		var min;
		var val;
		var i;

		min = PINF;
		for ( i = 0; i < opts.types.length; i++ ) {
			diff = editDistance( typedef, opts.types[ i ] );
			if ( diff === 0 ) {
				return null;
			}
			if ( diff < min ) {
				min = diff;
				val = opts.types[ i ];
			}
		}
		if ( min <= THRESHOLD ) {
			return val;
		}
		return null;
	}
Returns a corrected type definition if supplied a type definition with a typo.

@private
@param {string} typedef - type definition
@returns {(string|null)} correct type definition or `null`