Skip to content

Commit

Permalink
fix: isGitIgnoreComment
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 3, 2021
1 parent 770a4e5 commit 9717e0d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/path-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export function posixifyPath(givenPath) {
export function posixifyPathNormalized(givenPath) {
return posixifyPath(givenPath).replace(/[/\\]$/, "")
}
/**
* A line starting with # serves as a comment.
* Put a backslash ("\") in front of the first hash for patterns that begin with a hash.
*/
function isGitIgnoreComment(pattern) {
return pattern[0] === "#"
}

/**
* Trailing spaces should be removed unless they are quoted with backslash ("\ ").
*/
Expand Down

0 comments on commit 9717e0d

Please sign in to comment.