assertCompartment = (allegedCompartment, path, url) => {
  const compartment = Object(allegedCompartment);
  assert(
    allegedCompartment === compartment && !Array.isArray(compartment),
    `${path} must be an object, got ${allegedCompartment} in ${q(url)}`,
  );

  const {
    location,
    name,
    label,
    parsers,
    types,
    scopes,
    modules,
    policy,
    ...extra
  } = compartment;

  assertEmptyObject(
    extra,
    `${path} must not have extra properties, got ${q(
      Object.keys(extra),
    )} in ${q(url)}`,
  );

  assert.typeof(
    location,
    'string',
    `${path}.location in ${q(url)} must be string, got ${q(location)}`,
  );
  assert.typeof(
    name,
    'string',
    `${path}.name in ${q(url)} must be string, got ${q(name)}`,
  );
  assert.typeof(
    label,
    'string',
    `${path}.label in ${q(url)} must be string, got ${q(label)}`,
  );

  assertModules(modules, path, url);
  assertParsers(parsers, path, url);
  assertScopes(scopes, path, url);
  assertTypes(types, path, url);
  assertPolicy(policy, path, url);
}
@param {unknown} allegedCompartment
@param {string} path
@param {string} url