getInterfaceGuardPayload = interfaceGuard => {
  if (matches(interfaceGuard, InterfaceGuardShape)) {
    return interfaceGuard.payload;
  }
  mustMatch(interfaceGuard, LegacyInterfaceGuardShape, 'legacyInterfaceGuard');
  // @ts-expect-error Legacy adaptor can be ill typed
  // eslint-disable-next-line prefer-const
  let { klass: _, interfaceName, methodGuards, ...rest } = interfaceGuard;
  methodGuards = objectMap(methodGuards, adaptMethodGuard);
  const payload = harden({
    interfaceName,
    methodGuards,
    ...rest,
  });
  mustMatch(
    payload,
    InterfaceGuardPayloadShape,
    'internalInterfaceGuardAdaptor',
  );
  return payload;
}
By using this abstraction rather than accessing the properties directly,
we smooth the transition to https://github.com/endojs/endo/pull/1712,
tolerating both the legacy and current guard shapes.

Unlike LegacyAwaitArgGuardShape, tolerating LegacyInterfaceGuardShape
does not seem like a currently exploitable bug, because there is not
currently any context where either an interfaceGuard or a copyRecord would
both be meaningful.

@template {Record<PropertyKey, MethodGuard>} [T=Record<PropertyKey, MethodGuard>]
@param {InterfaceGuard<T>} interfaceGuard
@returns {InterfaceGuardPayload<T>}