Skip to content

Commit

Permalink
fix: globifyPath
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 3, 2021
1 parent 896ecfc commit 120eb16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/path-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ export function posixifyPathNormalized(givenPath) {
return posixifyPath(givenPath).replace(/[/\\]$/, "")
}

/**
* @param {string} givenPath The given path to be globified
* @param {string} givenDirectory [process.cwd()] The cwd to use to resolve relative pathnames
* @returns {string | [string, string]} The glob path or the file path itself
*/
export function globifyPath(givenPath, givenDirectory = process.cwd()) {
return globifyGitIgnoreEntry(posixifyPath(givenPath), givenDirectory)
}

/**
* Globifies a directory
* @param {string} givenDirectory The given directory to be globified
Expand Down

0 comments on commit 120eb16

Please sign in to comment.