mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Use declarations style for functions.
This commit is contained in:
@@ -8,8 +8,8 @@ export const BASE = 'http://test.com';
|
||||
/**
|
||||
* Returns a component instantiated from a Components.js configuration.
|
||||
*/
|
||||
export const instantiateFromConfig = async(componentUrl: string, configFile: string,
|
||||
variables?: Record<string, any>): Promise<any> => {
|
||||
export async function instantiateFromConfig(componentUrl: string, configFile: string,
|
||||
variables?: Record<string, any>): Promise<any> {
|
||||
// Initialize the Components.js loader
|
||||
const mainModulePath = joinFilePath(__dirname, '../../');
|
||||
const loader = new Loader({ mainModulePath });
|
||||
@@ -18,15 +18,16 @@ export const instantiateFromConfig = async(componentUrl: string, configFile: str
|
||||
// Instantiate the component from the config
|
||||
const configPath = toSystemFilePath(joinFilePath(__dirname, 'config', configFile));
|
||||
return loader.instantiateFromUrl(componentUrl, configPath, undefined, { variables });
|
||||
};
|
||||
}
|
||||
|
||||
export const getTestFolder = (name: string): string =>
|
||||
joinFilePath(__dirname, '../tmp', name);
|
||||
export function getTestFolder(name: string): string {
|
||||
return joinFilePath(__dirname, '../tmp', name);
|
||||
}
|
||||
|
||||
export const createFolder = (folder: string): void => {
|
||||
export function createFolder(folder: string): void {
|
||||
mkdirSync(folder, { recursive: true });
|
||||
};
|
||||
}
|
||||
|
||||
export const removeFolder = (folder: string): void => {
|
||||
export function removeFolder(folder: string): void {
|
||||
rimraf.sync(folder, { glob: false });
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user