Skip to content
Permalink
Browse files

🎨 rename a function

  • Loading branch information...
mysticatea committed Jan 3, 2019
1 parent 43e3198 commit 0225b02d0f3f8dbf2d2d52577455bf9817e925ca
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/util/get-npmignore.js
@@ -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)
}

@@ -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`
@@ -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) {
@@ -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)
)
}

0 comments on commit 0225b02

Please sign in to comment.
You can’t perform that action at this time.