'use strict';

var iconExtensionMap = {
	'audio/': 'audio',
	'application/pdf': 'pdf'
};

function getIconClassName(mimeType) {
	for (var pattern in iconExtensionMap) {
		if (mimeType.startsWith(pattern)) {
			return iconExtensionMap[pattern];
		}
	}
	return 'unknown';
}

module.exports = getIconClassName;

'use strict';

var iconExtensionMap = {
	'audio/': 'audio',
	'application/pdf': 'pdf'
};

function getIconClassName(mimeType) {
	for (var pattern in iconExtensionMap) {
		if (mimeType.indexOf(pattern) === 0) {
			return iconExtensionMap[pattern];
		}
	}
	return 'unknown';
}

module.exports = getIconClassName;

Swap out startsWith for indexOf = 0, which is supported in ie
Swap out startsWith for indexOf = 0, which is supported in ie
