<commit_before>import { has } from '../utils/object';
import { getName, quoteId, req } from '../utils/map-helpers';

export default function umd ( bundle, magicString, exportMode, options ) {
	const indentStr = magicString.getIndentString();

	const globalNames = options.globals || {};

	let amdDeps = bundle.externalModules.map( quoteId );
	let cjsDeps = bundle.externalModules.map( req );
	let globalDeps = bundle.externalModules.map( module => {
		return has( globalNames, module.id ) ? globalNames[ module.id ] : module.name;
	});

	let args = bundle.externalModules.map( getName );
<commit_msg>check for moduleName option when exporting from UMD bundle<commit_after>import { has } from '../utils/object';
import { getName, quoteId, req } from '../utils/map-helpers';

export default function umd ( bundle, magicString, exportMode, options ) {
	if ( exportMode !== 'none' && !options.moduleName ) {
		throw new Error( 'You must supply options.moduleName for UMD bundles' );
	}

	const indentStr = magicString.getIndentString();

	const globalNames = options.globals || {};

	let amdDeps = bundle.externalModules.map( quoteId );
	let cjsDeps = bundle.externalModules.map( req );
	let globalDeps = bundle.externalModules.map( module => {
		return has( globalNames, module.id ) ? globalNames[ module.id ] : module.name;
	});

	let args = bundle.externalModules.map( getName );

{'fraction_non_alphanumeric': 0.1312545322697607, 'fraction_numerical': 0.0, 'mean_word_length': 4.49800796812749, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4401623', 'n_tokens_mistral': 420, 'n_tokens_neox': 418, 'n_words': 116}