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(isAlpha): allow usage of options object #2086

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

pixelbucket-dev
Copy link

@pixelbucket-dev pixelbucket-dev commented Oct 24, 2022

This PR implements steps 1 and 2 of #1874 for isAlpha and builds upon #2075.

This PR extracts tests for isAlpha into a separate test file ⇾ test/validators/isAlpha.test.js (inspired by #1793).

Checklist

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

@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

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

Coverage data is based on head (0760c01) compared to base (54d330c).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2086   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          105       105           
  Lines         2324      2328    +4     
  Branches       586       588    +2     
=========================================
+ Hits          2324      2328    +4     
Impacted Files Coverage Δ
src/lib/isAlpha.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.

@pixelbucket-dev pixelbucket-dev changed the title Is alpha options refactor feat(isAlpha): allow usage of options object Oct 25, 2022
@pixelbucket-dev pixelbucket-dev marked this pull request as ready for review October 25, 2022 09:53
@WikiRik WikiRik added the 🧹 needs-update For PRs that need to be updated before landing label Jan 30, 2023
@WikiRik
Copy link
Member

WikiRik commented Feb 5, 2023

Do you want to work on isAlpha and isAlphanumeric in two separate PRs or in one PR? Seeing that you did some extra changes in #2087 by moving shared functionality together

@@ -1,5 +1,5 @@
import assert from 'assert';
import validator from '../index';
Copy link
Author

Choose a reason for hiding this comment

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

FYI: I don't know what this file is used for, but npm run lint:fix errors here.

@@ -1,26 +1,38 @@
import assertString from './util/assertString';
import { alpha } from './alpha';

export default function isAlpha(_str, locale = 'en-US', options = {}) {
assertString(_str);
Copy link
Author

Choose a reason for hiding this comment

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

In upstream this was removed. Any idea why, @WikiRik ?

Copy link
Author

Choose a reason for hiding this comment

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

I am referring to the function isAfter. Is it because toDate implicitely runs assertString in already?

@pixelbucket-dev
Copy link
Author

pixelbucket-dev commented Feb 5, 2023

Do you want to work on isAlpha and isAlphanumeric in two separate PRs or in one PR? Seeing that you did some extra changes in #2087 by moving shared functionality together

I can't remember where but I think we discussed previously that I do two separate PRs. It would be great if we could just merge this one quickly and then I optimise the PR for isAlphanumeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 needs-update For PRs that need to be updated before landing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants