这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Dec 6, 2023

Description:

This PR adds max and min utils

New features:

  • adds max util
  • adds min util

PR status:

  • Version bumped
  • Change-log updated
  • Tests added or updated
  • PR keeps 100% test coverage
  • Type definition updated
  • Readme updated
  • Linter is applied
  • Const arrow functions are used instead of pure function definitions where applicable
  • Functions are listed in alphabetic order in index.js, index.d.ts and readme

Copy link
Contributor

@dictor93 dictor93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments. The rest LGTM!

src/max.js Outdated

const determineExtremumValue = require('./util/determineExtremumValue')

const min = (array) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const min = (array) => {
const max = (array) => {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, thanks for typo detection

src/max.js Outdated
)
}

module.exports = min
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
module.exports = min
module.exports = max


return array.reduce((prev, curr) => {
if (isNil(curr)) {
return prev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems, this condition is not covered by tests

Copy link
Contributor

@dictor93 dictor93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, please add a test for letters as to prove this also works for text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants