src/core/InlineImport.js
function readImports(imports, data) {

	return (imports.length === 0) ? Promise.resolve([imports, data]) : new Promise((resolve, reject) => {

		let i = 0;

		(function proceed(error, importData) {

			if(importData) {

				imports[i++].data = importData;

			}

			if(error) {

				reject(error);

			} else if(i === imports.length) {

				resolve([imports, data]);

			} else {

				fs.readFile(imports[i].path, imports[i].encoding, proceed);

			}

		}());

	});

}
function readImports(imports, data) {

	return (imports.length === 0) ? Promise.resolve([imports, data]) : new Promise((resolve, reject) => {

		let i = 0;

		(function proceed(error, importData) {

			if(importData) {

				imports[i++].data = importData;

			}

			if(error) {

				reject(error);

			} else if(i === imports.length) {

				resolve([imports, data]);

			} else {

				fs.readFile(imports[i].path, imports[i].encoding, proceed);

			}

		}());

	});

}
Reads the contents of the imported files.

@private
@param {FileImport[]} imports - A list of relevant import statements.
@param {String} data - The file contents.
@return {Promise} A promise.