Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public static async instantiateComponent(configResourceUrl: string, instanceUri: string,
properties?: ISetupProperties): Promise {
if (!Setup.preparedPromises) {
Setup.preparedPromises = true;
Setup.preparePromises();
}
// Handle optional arguments
if (!properties) {
properties = {};
}
require('lodash.defaults')(properties, { mainModulePath: process.cwd() });
// Instantiate the given config file
const loader = new Loader(properties);
await loader.registerAvailableModuleResources();
return await loader.instantiateFromUrl(instanceUri, configResourceUrl);
}