code: function loadPlugin(descriptor, loader) {
    const config = Array.isArray(descriptor) ? descriptor : [descriptor];
    const [name, options = {}] = config;
    const { error, module: plugin } = loader(name);
  
    if (error) {
      return {
        error,
        name,
      };
    }
  
    if (typeof plugin !== 'function') {
      return {
        error: new Error(
          `Expected the plugin \`${name}\` to export a function, instead ` +
            `recieved: ${typeof plugin}`
        ),
        name,
      };
    }
  
    return {
      name,
      options,
      plugin,
    };
  }
docs: Load the plugin descriptor with the given loader
  @param {Descriptor} descriptor
  @param {Loader} loader