function _generateRUMHeader(options = {}, metadata, loader) {
  const formatArgs = []

  if (options.hasToRemoveScriptWrapper) {
    formatArgs.push(RUM_STUB)
  } else if (options.nonce) {
    formatArgs.push(RUM_STUB_SHELL_WITH_NONCE_PARAM, `nonce="${options.nonce}"`)
  } else {
    formatArgs.push(RUM_STUB_SHELL)
  }

  formatArgs.push(metadata, loader)

  return util.format(...formatArgs)
}
Function for generating a fully formed RUM header based on configuration options

@private
@param {object} options Configuration options for RUM
@param {string} [options.nonce] Nonce to inject into `<script>` header.
@param {boolean} [options.hasToRemoveScriptWrapper] Used to import agent script without `<script>` tag wrapper.
@param {string} metadata Stringified representation of rumHash metadata
@param {string} loader Agent Loader script
@returns {string} fully formed RUM header