assertTypes = (allegedTypes, path, url) => {
  if (allegedTypes === undefined) {
    return;
  }
  const types = Object(allegedTypes);
  assert(
    allegedTypes === types && !Array.isArray(types),
    `${path}.types must be an object, got ${allegedTypes} in ${q(url)}`,
  );

  for (const [key, value] of Object.entries(types)) {
    assert.typeof(
      key,
      'string',
      `all keys of ${path}.types must be strings, got ${key} in ${q(url)}`,
    );
    assert.typeof(
      value,
      'string',
      `${path}.types[${q(key)}] must be a string, got ${value} in ${q(url)}`,
    );
  }
}
@param {unknown} allegedTypes
@param {string} path
@param {string} url