function convertPath( from, to ) {
	var device;
	var parts;
	var out;
	if ( !isString( from ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', from ) );
	}
	if ( !isString( to ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a string. Value: `%s`.', to ) );
	}
	if (
		to !== 'win32' &&
		to !== 'mixed' &&
		to !== 'posix'
	) {
		throw new Error( format( 'invalid argument. Second argument must be a recognized output path convention. Value: `%s`.', to ) );
	}
	out = from;

	// Convert to a Windows path convention by transforming a POSIX device root (if present) and using a Windows path separator...
	if ( to === 'win32' ) {
		parts = RE_POSIX_DEVICE_ROOT.exec( out );
		if ( parts ) {
			device = parts[ 1 ]+':\\';
			out = replace( out, RE_POSIX_DEVICE_ROOT, device );
		}
		return replace( out, '/', '\\' );
	}
	// Check for Windows extended-length paths...
	if ( reExtendedLengthPath.REGEXP.test( from ) ) {
		throw new Error( format( 'invalid argument. Cannot convert Windows extended-length paths to POSIX paths. Value: `%s`.', from ) );
	}
	// Convert to a mixed path convention by combining a Windows drive letter convention with a POSIX path separator...
	if ( to === 'mixed' ) {
		parts = RE_POSIX_DEVICE_ROOT.exec( out );
		if ( parts ) {
			device = parts[ 1 ]+':/';
			out = replace( out, RE_POSIX_DEVICE_ROOT, device );
		} else {
			parts = RE_WIN_DEVICE_ROOT.exec( out );
			if ( parts ) {
				device = parts[ 1 ]+':/';
				out = replace( out, RE_WIN_DEVICE_ROOT, device );
			}
		}
		return replace( out, '\\', '/' );
	}
	// Convert to a POSIX path convention by transforming a Windows device root (if present) and using a POSIX path separator...
	parts = RE_WIN_DEVICE_ROOT.exec( out );
	if ( parts ) {
		device = '/'+lowercase( parts[ 1 ] )+'/';
		out = replace( out, RE_WIN_DEVICE_ROOT, device );
	}
	return replace( out, '\\', '/' );
}
Converts between POSIX and Windows paths.

@param {string} from - path to convert
@param {string} to - output path convention
@throws {TypeError} first argument must be a string
@throws {TypeError} second argument must be a string
@throws {RangeError} second argument must be a recognized output path convention
@throws {Error} cannot convert a Windows extended-length path to a non-Windows path convention
@returns {string} converted path

@example
var p = convertPath( '/c/foo/bar/beep.c', 'win32' );
// returns 'c:\foo\bar\beep.c'

@example
var p = convertPath( '/c/foo/bar/beep.c', 'mixed' );
// returns 'c:/foo/bar/beep.c'

@example
var p = convertPath( 'C:\\foo\\bar\\beep.c', 'posix' );
// returns '/c/foo/bar/beep.c'

@example
var p = convertPath( 'C:\\foo\\bar\\beep.c', 'mixed' );
// returns 'C:/foo/bar/beep.c'