Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function ensureDatatypeExtracted(addressSpace: any): Promise {
const addressSpacePriv: any = addressSpace as any;
if (!addressSpacePriv.$$extraDataTypeManager) {
const session = new PseudoSession(addressSpace);
const extraDataTypeManager = new ExtraDataTypeManager();
const namespaceArray =
addressSpace.getNamespaceArray().map((n: Namespace) => n.namespaceUri);
debugLog("Namespace Array = ", namespaceArray);
extraDataTypeManager.setNamespaceArray(namespaceArray);
await extractNamespaceDataType(session, extraDataTypeManager);
addressSpacePriv.$$extraDataTypeManager = extraDataTypeManager;
}
return addressSpacePriv.$$extraDataTypeManager;
}
export const ensureDatatypeExtractedWithCallback = callbackify(ensureDatatypeExtracted) as any;