mage-validator
Version:
Validation utility for MAGE user commands & topics (TypeScript)
25 lines (24 loc) • 768 B
TypeScript
/**
* Load topics from each module's 'topics' folder
*
* This function is a helper you will use in your project's
* `lib/archivist/index.js` file, as follow:
*
* ```typescript
* import { loadTopicsFromModules } from 'mage-validator'
*
* loadTopicsFromModules(exports)
* ```
*
* This will:
*
* - Find all your projetc's modules
* - For each module folders, check if there is a `topics` folder
* - When a `topics` folder is found, require each file in it
* - Add the content of the require to exports[fileNameWithoutJSExtension]
*/
export declare function loadTopicsFromModules(exports: any): void;
/**
* Load topics defined in a single module
*/
export declare function loadTopicsFromModule(archivistExports: any, moduleName: string): void;