Current section

Files

Jump to
gossamer src utils runtime_gap.ffi.mjs
Raw

src/utils/runtime_gap.ffi.mjs

// src/utils/runtime_gap.ffi.ts
import { isIndexable } from "./object.ffi.mjs";
function ensureMethod(obj, method, binding, issueUrl) {
if ((isIndexable(obj) || typeof obj === "function") && typeof Reflect.get(obj, method) === "function") return;
const suffix = issueUrl ? ` - see ${issueUrl}` : "";
throw new Error(
`gossamer.${binding} is unavailable on this runtime${suffix}`
);
}
export {
ensureMethod
};