Skip to content

enforceExistence for local functions #110

@wbyoung

Description

@wbyoung

If I have a function that's only ever used inside of another function, I don't think it should it require documentation:

/**
 * Find capitalized words.
 */
var capitalizedWords = function(words) {
  var isCapitalized = function(string) { return string.match(/^[A-Z]/); };
  return words.filter(isCapitalized);
};

In the above example, isCapitalized would never be accessible to anyone. This doesn't seem much different from not documenting the anonymous version:

/**
 * Find capitalized words.
 */
var capitalizedWords = function(words) {
  return words.filter(function(string) { return string.match(/^[A-Z]/); });
};

Would an option for enforceExistence to let these go undocumented be a good addition? Would it be hard to add?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions