Replaces the affected import statements with the actual file contents.

@private
@param {FileImport[]} imports - A list of all relevant imports.
@param {String} data - The original file contents.
@param {String} declaration - The import variable declaration.
@return {Promise} A promise.
function inlineImports(imports, data, declaration) {

	let modified = imports.length > 0;
	let i, item;

	// Inline the imports in reverse order to keep the indices intact.
	for(i = imports.length - 1; i >= 0; --i) {

		item = imports[i];

		data = data.substring(0, item.start) +
			declaration + " " + item.name + " = " + JSON.stringify(item.data) +
			data.substring(item.end);

	}

	return Promise.resolve([modified, data]);

}