eggheadio-github / stack-overflow-copy-paste

Utility functions copy/pasted (and modified slightly) from Stack Overflow
441 stars 606 forks source link

`cube` and `square` functions should use `to-power` function #224

Closed baruchvlz closed 5 years ago

baruchvlz commented 5 years ago

It would make sense to use the library internally. cube and square could use is-power.

Example:

import toPower from './to-power'

function cube(number) {
  return toPower(number, 3)
}

// cube(2) -> 8
kentcdodds commented 5 years ago

Hi @baruchvlz!

If this library were supposed to be useful and used then I would agree with you, but the library is intended to just be a place for people to practice making pull requests so I actually don't care about the quality of the code and actually prefer every function to be totally isolated and separate to make things easier for people to contribute.

Thanks@