Skip to content

Commit 0225b02

Browse files
committedJan 3, 2019
🎨 rename a function
1 parent 43e3198 commit 0225b02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎lib/util/get-npmignore.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const NEVER_IGNORED = /^(?:readme\.[^.]*|(?:licen[cs]e|changes|changelog|history
2424
* @returns {boolean} `true` if the file name is a relative path to a ancestor
2525
* directory.
2626
*/
27-
function notAncestorFiles(filePath) {
27+
function isAncestorFiles(filePath) {
2828
return PARENT_RELATIVE_PATH.test(filePath)
2929
}
3030

@@ -124,7 +124,7 @@ function parseNpmignore(basedir, filesFieldExists) {
124124
}
125125

126126
/**
127-
* Gets an object to check whether or not a given path should be ignored.
127+
* Gets an object to check whether a given path should be ignored or not.
128128
* The object is created from:
129129
*
130130
* - `files` field of `package.json`
@@ -137,7 +137,7 @@ function parseNpmignore(basedir, filesFieldExists) {
137137
* `match` returns `true` if a given file path should be ignored.
138138
*/
139139
module.exports = function getNpmignore(startPath) {
140-
const retv = { match: notAncestorFiles }
140+
const retv = { match: isAncestorFiles }
141141

142142
const p = getPackageJson(startPath)
143143
if (p) {
@@ -155,17 +155,17 @@ module.exports = function getNpmignore(startPath) {
155155
if (filesIgnore && npmignoreIgnore) {
156156
retv.match = and(
157157
filterNeverIgnoredFiles(p),
158-
or(notAncestorFiles, filesIgnore, npmignoreIgnore)
158+
or(isAncestorFiles, filesIgnore, npmignoreIgnore)
159159
)
160160
} else if (filesIgnore) {
161161
retv.match = and(
162162
filterNeverIgnoredFiles(p),
163-
or(notAncestorFiles, filesIgnore)
163+
or(isAncestorFiles, filesIgnore)
164164
)
165165
} else if (npmignoreIgnore) {
166166
retv.match = and(
167167
filterNeverIgnoredFiles(p),
168-
or(notAncestorFiles, npmignoreIgnore)
168+
or(isAncestorFiles, npmignoreIgnore)
169169
)
170170
}
171171

0 commit comments

Comments
 (0)