Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta: principles for accepting new function proposals #55

Closed
rarkins opened this issue May 26, 2018 · 1 comment
Closed

Meta: principles for accepting new function proposals #55

rarkins opened this issue May 26, 2018 · 1 comment
Labels

Comments

@rarkins
Copy link

rarkins commented May 26, 2018

It could be useful to expand in the FAQ or add a CONTRIBUTING.md stating what the principles are for deciding future function proposals. e.g. if the project's intention is to be strict, reasons to reject might include:

  • The alternative code it's replacing reads nicely anyway
  • It can be composed of two existing functions
  • It's just the negation of an existing function

Or perhaps you even consider it mostly feature-complete and prefer not to "bloat" it with many new functions?

On the other hand we're usually talking about one-liners with negligible bloat or maintenance burden, so rules under a flexible approach might be:

  • Unsurprising
  • Unlikely to result in confusion
@sindresorhus
Copy link
Owner

I think it's hard to define this upfront.

The alternative code it's replacing reads nicely anyway

It depends. Maybe if it reads even nicer.

It can be composed of two existing functions

Probably better to use two function, however if it's something that is very common, it might make sense to make it an utility method.

It's just the negation of an existing function

If a check does multiple things, just negating the result might not be correct, hence it needs a negated method, like is.emptyObject and is.notEmptyObject. If you negative is.emptyObject and pass in a non-object it will not give you what you intended to check for.


So tl;dr, it really depends and I don't want to assume too much. I would prefer just hearing people out first instead of blocking ideas before they have had a chance to evolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants