function encodeLoader(loader) {
  if (typeof loader === 'string') {
    return loader;
  }

  if (typeof loader.options !== 'undefined') {
    const query = Object.keys(loader.options)
      .map(param => `${encodeURIComponent(param)}=${encodeURIComponent(loader.options[param])}`)
      .join('&');
    return `${loader.loader}?${query}`;
  }
  return loader.loader;
}
@summary: The encoder function is capable to apply either incoming strings from webpack modules or objects.
@param loader
@returns {string}