nope/lib/loader/nopePackageLoader.nodejs.ts
Martin Karkowski d911380511 # 1.0.27
- 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.
2022-03-22 10:12:32 +01:00

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 = [];
}
}
}