MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / unwrap

Function unwrap

packages/node/src/worker/engineWorker.ts:98–105  ·  view source on GitHub ↗
(m: unknown)

Source from the content-addressed store, hash-verified

96 const shim = typeof wd.nativeShimModule === "string" ? wd.nativeShimModule : null;
97
98 const unwrap = (m: unknown): NativeApi => {
99 if (typeof m === "object" && m !== null) {
100 const rec = m as { native?: unknown; default?: unknown };
101 const candidate = (rec.native ?? rec.default ?? rec) as unknown;
102 return candidate as NativeApi;
103 }
104 return m as NativeApi;
105 };
106
107 if (shim !== null && shim.length > 0) {
108 return unwrap((await import(shim)) as unknown);

Callers 1

loadNativeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected