Skip to content

Commit

Permalink
🎨 rename a function
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jan 3, 2019
1 parent 43e3198 commit 0225b02
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/util/get-npmignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const NEVER_IGNORED = /^(?:readme\.[^.]*|(?:licen[cs]e|changes|changelog|history
* @returns {boolean} `true` if the file name is a relative path to a ancestor
* directory.
*/
function notAncestorFiles(filePath) {
function isAncestorFiles(filePath) {
return PARENT_RELATIVE_PATH.test(filePath)
}

Expand Down Expand Up @@ -124,7 +124,7 @@ function parseNpmignore(basedir, filesFieldExists) {
}

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

const p = getPackageJson(startPath)
if (p) {
Expand All @@ -155,17 +155,17 @@ module.exports = function getNpmignore(startPath) {
if (filesIgnore && npmignoreIgnore) {
retv.match = and(
filterNeverIgnoredFiles(p),
or(notAncestorFiles, filesIgnore, npmignoreIgnore)
or(isAncestorFiles, filesIgnore, npmignoreIgnore)
)
} else if (filesIgnore) {
retv.match = and(
filterNeverIgnoredFiles(p),
or(notAncestorFiles, filesIgnore)
or(isAncestorFiles, filesIgnore)
)
} else if (npmignoreIgnore) {
retv.match = and(
filterNeverIgnoredFiles(p),
or(notAncestorFiles, npmignoreIgnore)
or(isAncestorFiles, npmignoreIgnore)
)
}

Expand Down

0 comments on commit 0225b02

Please sign in to comment.