Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected async loadStdFormat(type: QuantityType, imperial: boolean): Promise {
let formatData: any;
const formatArray = imperial ? defaultsFormats.imperial : defaultsFormats.metric;
for (const entry of formatArray) {
if (entry.type === type as number) {
formatData = entry.format;
const format = new Format("stdFormat");
await format.fromJson(this, formatData);
return Promise.resolve(format);
}
}
throw new BentleyError(BentleyStatus.ERROR, "IModelApp must define a formatsProvider class to provide formats for tools");
}