Martin Karkowski
d911380511
- Fixes: - helpers.jsonSchemaMethods: -> renamed flatten to nested. - Added: - helpers.descriptors: -> parseFunctionToJsonSchema - helpers.jsonSchemaMethods: -> added `flattenSchema` and `reduceSchema`. This Function will create a nested JSON-Schema.
33 lines
871 B
TypeScript
33 lines
871 B
TypeScript
/**
|
|
* @author Martin Karkowski
|
|
* @email m.karkowski@zema.de
|
|
* @desc [description]
|
|
*/
|
|
|
|
import { injectable } from "inversify";
|
|
import { resolve } from "path";
|
|
import "reflect-metadata";
|
|
import { IPackageDescription } from "../types/nope/nopePackage.interface";
|
|
import { NopePackageLoader } from "./nopePackageLoader";
|
|
|
|
/**
|
|
* Helper Class to Build an inversify Container.
|
|
*
|
|
* @export
|
|
* @class NopePackageLoader
|
|
* @implements {INopePackageLoader}
|
|
*/
|
|
@injectable()
|
|
export class NopePackageLoaderFileAccess extends NopePackageLoader {
|
|
async loadPackageFile(path: string, useAutostart = true, useInstance = true) {
|
|
const loadedPackage = (await import(resolve(path)))
|
|
.DESCRIPTION as IPackageDescription<any>;
|
|
if (!useAutostart) {
|
|
loadedPackage.autostart = {};
|
|
}
|
|
if (!useInstance) {
|
|
loadedPackage.defaultInstances = [];
|
|
}
|
|
}
|
|
}
|