in lib/host.ts [366:406]
public static fromConfigObject(jsValue: any, basePath: string): HostSettings {
utils.ensureSchema(jsValue, this.SETTINGS_SCHEMA);
let typeDefinitions: TypeDef[] = [];
if (jsValue.objectTypes != null) {
for (let fileName of <string[]>(jsValue.objectTypes)) {
let filePath = path.resolve(basePath, fileName);
typeDefinitions = typeDefinitions.concat(TypeConfig.fromConfig(filePath));
}
}
let providerDefinitions: ProviderDef[] = [];
if (jsValue.objectProviders != null) {
for (let fileName of <string[]>(jsValue.objectProviders)) {
let filePath = path.resolve(basePath, fileName);
providerDefinitions = providerDefinitions.concat(ProviderConfig.fromConfig(filePath));
}
}
let namedObjectDefinitions: NamedObjectDef[] = [];
if (jsValue.namedObjects != null ){
for (let fileName of <string[]>(jsValue.namedObjects)) {
let filePath = path.resolve(basePath, fileName);
namedObjectDefinitions = namedObjectDefinitions.concat(NamedObjectConfig.fromConfig(filePath));
}
}
return {
baseDir: basePath,
allowPerRequestOverride: jsValue.allowPerRequestOverride,
throwExceptionOnError: jsValue.throwExceptionOnError,
defaultExecutionStack: jsValue.defaultExecutionStack,
objectContextDef: new ScopedObjectContextDef(
null,
typeDefinitions,
providerDefinitions,
namedObjectDefinitions,
true)
};
}