function sanitizePluginOptions(options) {
  // Allow .cliOptions to be defined either as a method, returning an object
  // or an object propety directly (computed or not)
  const cliOptions = typeof options === 'function' ? options() : options;

  const isValidType =
    typeof cliOptions === 'object' &&
    cliOptions !== undefined &&
    cliOptions.constructor === Object;

  if (!isValidType) {
    const current = format(cliOptions);
    throw new Error(`Invalid CLI options defined for plugin: ${current}`);
  }

  return cliOptions;
}
@param {Object<string, any>} options The plugin options to normalise