function duration2ms( str ) {
	var duration;
	var out;

	if ( !isDurationString( str ) ) {
		throw new TypeError( format( 'invalid argument. Must provide a valid duration string. Value: `%s`.', str ) );
	}
	duration = parseDuration( str );
	out = duration.days * 86400000;
	out += duration.hours * 3600000;
	out += duration.minutes * 60000;
	out += duration.seconds * 1000;
	out += duration.milliseconds;
	return out;
}
Converts a duration string to milliseconds.

## Notes

-   A duration string is a string containing a sequence of time units. A time unit is a nonnegative integer followed by a unit identifier. The following unit identifiers are supported:

    -   `d`: days
    -   `h`: hours
    -   `m`: minutes
    -   `s`: seconds
    -   `ms`: milliseconds

    For example, the string `1m3s10ms` is a duration string containing three time units: `1m` (1 minute), `3s` (3 seconds), and `10ms` (10 milliseconds). The string `60m` is a duration string containing a single time unit: `60m` (60 minutes).

-   Duration strings are case insensitive. For example, the string `1M3S10MS` is equivalent to `1m3s10ms`.

@param {string} str - duration string
@throws {TypeError} must provide a duration string
@returns {NonNegativeInteger} milliseconds

@example
var ms = duration2ms( '1d' );
// returns 86400000

@example
var ms = duration2ms( '1d2h3m4s5ms' );
// returns 93784005