Skip to content

Commit

Permalink
rollback to using glob (from fast-glob). jsdoc2md/jsdoc-to-markdown#300
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Jul 24, 2024
1 parent 40abc86 commit 33bf5e1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 246 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')
const Cache = require('cache-point')
const DmdOptions = require('./lib/dmd-options')
const dmdVersion = require('./package').version
const fastGlob = require('fast-glob')
const FileSet = require('file-set')

/**
* Transforms doclet data into markdown documentation.
Expand Down Expand Up @@ -52,8 +52,8 @@ function generate (templateData, options) {
const DmdOptions = require('./lib/dmd-options')

function registerPartials (paths) {
const files = fastGlob.globSync(paths, { onlyFiles: true })
for (const file of files) {
const fileSet = new FileSet(paths)
for (const file of fileSet.files) {
handlebars.registerPartial(
path.basename(file, '.hbs'),
fs.readFileSync(file, 'utf8') || ''
Expand All @@ -62,8 +62,8 @@ function generate (templateData, options) {
}

function registerHelpers (helpers) {
const files = fastGlob.globSync(helpers, { onlyFiles: true })
for (const file of files) {
const fileSet = new FileSet(helpers)
for (const file of fileSet.files) {
handlebars.registerHelper(require(path.resolve(process.cwd(), file)))
}
}
Expand Down
Loading

0 comments on commit 33bf5e1

Please sign in to comment.