MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / auditIfc

Function auditIfc

src/ifctester/webapp/src/modules/wasm/worker/api.ts:108–132  ·  view source on GitHub ↗
(ifcId: string, idsData: number[] | Uint8Array | ArrayBuffer)

Source from the content-addressed store, hash-verified

106}
107
108export async function auditIfc(ifcId: string, idsData: number[] | Uint8Array | ArrayBuffer) {
109 const reporter = pyodide.pyimport("ifctester.reporter");
110 const api = pyodide.pyimport("api");
111
112 const idsString = new TextDecoder().decode(new Uint8Array(idsData));
113 const specs = api.ids_from_xml_string(idsString, true);
114 const ifc = LoadedIFC.get(ifcId);
115
116 // Run audit
117 specs.validate(ifc);
118
119 // Create report in both HTML and JSON formats
120 const jsonReporter = reporter.Json(specs);
121 jsonReporter.report();
122 const jsonReport = jsonReporter.to_string();
123
124 const htmlReporter = reporter.Html(specs);
125 htmlReporter.report();
126 const htmlReport = htmlReporter.to_string();
127
128 return {
129 json: JSON.parse(jsonReport) as AuditReportData,
130 html: htmlReport
131 };
132}
133
134// Expose interface
135export const API = {

Callers

nothing calls this directly

Calls 6

decodeMethod · 0.45
getMethod · 0.45
validateMethod · 0.45
reportMethod · 0.45
to_stringMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected