Skip to content

Commit

Permalink
Merge pull request #75 from tuatmcc/hotfix/type_export
Browse files Browse the repository at this point in the history
[fix]: type export and multi category handling
  • Loading branch information
OJII3 authored Nov 17, 2023
2 parents 0e39fb9 + 977a7f8 commit 858330c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/type.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { UserConfig, FieldConfig, DocumentConfig } from '../src/types';
export { UserConfig, FieldConfig, CategoryConfig } from '../src/types';
17 changes: 11 additions & 6 deletions src/modulegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ export class ModuleGenerator {
`Generated ${documentModules.length} modules for ${categoryConfig.documentCategory}`,
);

this.categoryModules = this.categoryModules.map((categoryModule) => {
return {
documentCategory: categoryModule.documentCategory,
documentModules: documentModules,
};
});
try {
this.categoryModules[
this.categoryModules.findIndex((m) => {
m.documentCategory === categoryConfig.documentCategory;
})
].documentModules = documentModules;
} catch (e) {
console.log(
`Skipping ${categoryConfig.documentCategory} due to error: ${e.message}`,
);
}
}
return this.categoryModules;
}
Expand Down

0 comments on commit 858330c

Please sign in to comment.