function assertNoExcessProperties(obj, pluginName, objectName = '') {
  if (objectName) {
    objectName += ' ';
  }

  const invalidKeys = Object.keys(obj);
  if (invalidKeys.length > 0) {
    const keys = invalidKeys.join(', ');
    throw new Error(`${pluginName} has unrecognized ${objectName}properties: [${keys}]`);
  }
}
Asserts that obj has no own properties, throwing a nice error message if it does.
Plugin and object name are included for nicer logging.
@param {Record<string, unknown>} obj
@param {string} pluginName
@param {string=} objectName