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

feat(isAfter): allow usage of options object #2075

Merged

Conversation

WikiRik
Copy link
Member

@WikiRik WikiRik commented Oct 18, 2022

This PR implements steps 1 and 2 of #1874 for isAfter. It also has a commit to allow for splitting tests to different files which can be made into a separate PR if requested, this part is inspired by #1793.

For the change in the README I've chosen for something comparable to contains which I quite liked. This format would be used for the other refactors as well, so feel free to comment with other suggestions.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@WikiRik
Copy link
Member Author

WikiRik commented Oct 18, 2022

@rubiin @braaar what do you think?

@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (991bb07) compared to base (b2a999d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2075   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          105       105           
  Lines         2335      2334    -1     
  Branches       586       586           
=========================================
- Hits          2335      2334    -1     
Impacted Files Coverage Δ
src/lib/toDate.js 100.00% <ø> (ø)
src/lib/isAfter.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rubiin
Copy link
Member

rubiin commented Oct 18, 2022

Looks like a nice addition IMO. Since this is a common use case, Lets add it

braaar
braaar previously approved these changes Oct 19, 2022
Copy link
Contributor

@braaar braaar left a comment

Choose a reason for hiding this comment

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

Looks good!

test/validators.js Outdated Show resolved Hide resolved
@WikiRik WikiRik requested review from braaar and removed request for profnandaa and tux-tn October 19, 2022 09:06
@WikiRik
Copy link
Member Author

WikiRik commented Oct 19, 2022

Not sure how I removed the review requests of the maintainers, but obviously I still want them. Just wanted to re-request it from @braaar

@braaar
Copy link
Contributor

braaar commented Oct 19, 2022

I think camelCase is the preferred naming convention for files – I let my kebab-case habits affect my suggestion 😅

braaar
braaar previously approved these changes Oct 19, 2022
@WikiRik
Copy link
Member Author

WikiRik commented Oct 21, 2022

@pixelbucket-dev had a good point here which I will incorporate in this PR as well.
#2019 (comment)

rubiin
rubiin previously approved these changes Oct 23, 2022
src/lib/isAfter.js Outdated Show resolved Hide resolved
@WikiRik WikiRik requested review from rubiin and braaar and removed request for rubiin and braaar October 23, 2022 21:45
rubiin
rubiin previously approved these changes Oct 24, 2022
Copy link
Member

@rubiin rubiin left a comment

Choose a reason for hiding this comment

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

Nice work on the file renames as well. Meant to do it sooner or later

@pixelbucket-dev
Copy link

I think camelCase is the preferred naming convention for files – I let my kebab-case habits affect my suggestion 😅

Is it though? I think that pattern was introduced by React, but in JS world, before React, kebap-case was the default for file names. Especially since code should work on different file system, which are not case-sensitive. You can check:

https://google.github.io/styleguide/jsguide.html
https://stackoverflow.com/questions/7273316/what-is-the-javascript-filename-naming-convention

In the end, this topic is quite opinionated 😄, but keeping things backwards-compatible should dictate lower-case file names.

However, the most important rule should be consistency :).

src/lib/isAfter.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants