Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict'
const GithubSlugger = require('github-slugger')
const hljs = require('highlight.js')
const util = require('documentation').util
const createFormatters = util.createFormatters
const LinkerStack = util.LinkerStack
const _ = require('lodash')
module.exports = class Utils {
constructor (options, comments) {
this.linkerStack = new LinkerStack(options)
.namespaceResolver(comments, (namespace) => {
const slugger = new GithubSlugger()
return '#' + slugger.slug(namespace)
})
this.options = options
this.comments = comments
this.formatters = createFormatters(this.linkerStack.link)
this.options.hljs = this.options.hljs || {}