diff --git a/src/factory.ts b/src/factory.ts index f806f5c..0ee82a1 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -90,7 +90,13 @@ async function getModelContents(model: FactoryOptions["model"]) { 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 { const modelPath = path.resolve(model) + (!!model && !path.extname(model) ? ".pass" : ""); 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((acc, current) => { // Checking if current file is one of the autogenerated ones or if its // content is not available