'use strict'

var shimmer = require('../shimmer')
var templateShared = require('../template-shared')

module.exports = function (pug, agent, { enabled }) {
  if (!enabled) return pug
  agent.logger.debug('shimming pug.compile')
  shimmer.wrap(pug, 'compile', templateShared.wrapCompile(agent, 'pug'))

  return pug
}
