whole_func_string: function parseNpmignore(basedir, filesFieldExists) {
      let filePath = path.join(basedir, ".npmignore")
      if (!exists(filePath)) {
          if (filesFieldExists) {
              return null
          }
  
          filePath = path.join(basedir, ".gitignore")
          if (!exists(filePath)) {
              return null
          }
      }
  
      const ig = ignore()
      ig.add(fs.readFileSync(filePath, "utf8"))
      return not(ig.createFilter())
  }
func_code_string: function parseNpmignore(basedir, filesFieldExists) {
      let filePath = path.join(basedir, ".npmignore")
      if (!exists(filePath)) {
          if (filesFieldExists) {
              return null
          }
  
          filePath = path.join(basedir, ".gitignore")
          if (!exists(filePath)) {
              return null
          }
      }
  
      const ig = ignore()
      ig.add(fs.readFileSync(filePath, "utf8"))
      return not(ig.createFilter())
  }
func_documentation_string: Creates a function which checks whether or not a given file should be ignored.
  
  @param {string} basedir - The directory path "package.json" exists.
  @param {boolean} filesFieldExists - `true` if `files` field of `package.json` exists.
  @returns {function|null} A function which checks whether or not a given file should be ignored.