Skip to content

Commit

Permalink
Adds JsDoc example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Jun 12, 2023
1 parent 49639e7 commit 8927ab3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ export type Options = {

/**
* A Metalsmith plugin to remove files from the build
*
* @example
* // remove all dotfiles that are direct children of metalsmith.source()
* metalsmith.use(remove('.*'))
* // remove all JSON files
* metalsmith.use(remove(['**\/*.json']))
*/
declare function remove(
/** One or more [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming)) */
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function normalizeOptions(options) {
*
* @param {String|String[]|Options} [options] One or more [glob patterns](https://en.wikipedia.org/wiki/Glob_(programming))
* @return {import('metalsmith').Plugin}
* @example
* // remove all dotfiles that are direct children of metalsmith.source()
* metalsmith.use(remove('.*'))
* // remove all JSON files
* metalsmith.use(remove(['**\/*.json']))
*/
function remove(options) {
return function remove(files, metalsmith, done) {
Expand Down

0 comments on commit 8927ab3

Please sign in to comment.