Added function comments to factory model analysis functions

This commit is contained in:
Alexander Cerutti
2019-06-01 00:25:16 +02:00
parent 3976d86aa1
commit b3b0b1c877

View File

@@ -90,7 +90,13 @@ async function getModelContents(model: FactoryOptions["model"]) {
return modelContents; return modelContents;
} }
async function getModelFolderContents(model: string) { /**
* Reads and model contents and creates a splitted
* bundles-object.
* @param model
*/
async function getModelFolderContents(model: string): Promise<PartitionedBundle> {
const modelPath = path.resolve(model) + (!!model && !path.extname(model) ? ".pass" : ""); const modelPath = path.resolve(model) + (!!model && !path.extname(model) ? ".pass" : "");
const modelFilesList = await readDir(modelPath); const modelFilesList = await readDir(modelPath);
@@ -147,7 +153,13 @@ async function getModelFolderContents(model: string) {
}; };
} }
function getModelBufferContents(model: BundleUnit) { /**
* Analyzes the passed buffer model and splits it to
* return buffers and localization files buffers.
* @param model
*/
function getModelBufferContents(model: BundleUnit): PartitionedBundle {
const bundle = removeHidden(Object.keys(model)).reduce<BundleUnit>((acc, current) => { const bundle = removeHidden(Object.keys(model)).reduce<BundleUnit>((acc, current) => {
// Checking if current file is one of the autogenerated ones or if its // Checking if current file is one of the autogenerated ones or if its
// content is not available // content is not available