function convert( value ) {
	if ( isString( value ) ) {
		value = Date.parse( value );
		if ( value !== value ) {
			return new TypeError( format( 'invalid argument. Unable to parse date string. Value: `%s`.', value ) );
		}
		return value;
	}
	if ( isNonNegativeInteger( value ) ) {
		return value;
	}
	if ( isDateObject( value ) ) {
		return value.getTime();
	}
	return new TypeError( format( 'invalid argument. Must provide either a Date object, a JavaScript timestamp (i.e., a nonnegative integer), or a date string. Value: `%s`.', value ) );
}
Converts a value to a JavaScript timestamp.

@private
@param {*} value - value to convert
@returns {(NonNegativeInteger|Error)} either a JavaScript timestamp or an error object