Skip to content

Feat: Add minDigitChars - #1111

Open
will-stone wants to merge 5 commits into
open-circle:mainfrom
will-stone:feat-min-digits
Open

Feat: Add minDigitChars#1111
will-stone wants to merge 5 commits into
open-circle:mainfrom
will-stone:feat-min-digits

Conversation

@will-stone

@will-stone will-stone commented Mar 25, 2025

Copy link
Copy Markdown

Hi Fabian 👋 🙂

Long time fan of this project. Thought I'd make a contribution...

Added a check for minimum amount of digits in a string. Useful for password validation. Only thing I haven't done is update the i18n package, are we expected to do that?

Also, I noticed that when running pnpm -F valibot test it creates a tsconfig.vitest-temp.json file so have added a commit to ignore that.

Thanks,

Will.

Summary by CodeRabbit

  • New Features
    • Added minDigitChars validation action for strings, plus a digit-count utility used by the action.
  • Tests
    • Added unit and type-level coverage for digit counting, minDigitChars construction, and validation/inference behavior.
  • Documentation
    • Added complete API documentation for minDigitChars and its related types, and updated API listings/menus to include it.
  • Chores
    • Updated project ignore settings for test artifacts and extended public re-exports for the new utilities/actions.

@vercel

vercel Bot commented Mar 25, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
valibot ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 19, 2025 8:43pm

@fabian-hiller

Copy link
Copy Markdown
Member

Thanks for the PR! Great idea! Since this is a very specific action, I may wait for more developers to express interest in such a feature before reviewing and merging it.

@fabian-hiller fabian-hiller self-assigned this Mar 31, 2025
@fabian-hiller fabian-hiller added enhancement New feature or request workaround Workaround fixes problem labels Mar 31, 2025
@pkg-pr-new

pkg-pr-new Bot commented Mar 31, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1111

commit: d6c5269

@will-stone

Copy link
Copy Markdown
Author

Thanks @fabian-hiller 🙂 If this was accepted, I was going to propose:

  • maxDigits
  • minLetters
  • maxLetters

I'd also like minSpecialCharacters but not sure yet how to do that, that couldn't lead to possible regex injection.

@will-stone

Copy link
Copy Markdown
Author

If anyone stumbles across this and is looking for a way to implement this now, you can use this:

const minDigits = (min: number) =>
  v.pipe(
    v.string(),
    v.check(
      (input) => (input.match(/\d/gu) || []).length >= min,
      `Must contain at least ${min} digit${min === 1 ? "" : "s"}.`,
    ),
  )

v.safeParse(minDigits(2), 'I have no digits')

@fabian-hiller

Copy link
Copy Markdown
Member

In general, I am very interested in providing actions to validate the number of digits, letters and special characters, but we need to find perfect names for them. Valibot usually provides actions like length, notLength, minLength and maxLength to cover every possible case. So I am not sure if we should stick to the name minDigits since we already have a digits action that does not validate the number of digits. So maybe we should rename it to something like minDigitChars. I recommend brainstorming about the perfect names in a first step. In a second step we will make this PR perfect and merge it, and in a third step we can create PRs for all the other actions.

@will-stone

Copy link
Copy Markdown
Author

Ah, of course; I saw digits and associated it with bytes and length. As for naming, it does feel like digits is the odd one out here. Perhaps it could be enhanced, to avoid a breaking change, like so?

v.digits('The string contains something other than digits.')
v.digits(8, 'Exactly 8 digits are required.')

@fabian-hiller

Copy link
Copy Markdown
Member

I don't recommend this as it would make our API inconsistent. What about minDigitChars, minSpecialChars and minLetterChars?

@will-stone

Copy link
Copy Markdown
Author

Okay let's go with that 👍 🙂 I'll update this PR when I can a moment. Thanks.

@will-stone
will-stone force-pushed the feat-min-digits branch 3 times, most recently from 89108b1 to 5582469 Compare April 19, 2025 20:38
@will-stone will-stone changed the title Feat: Add minDigits Feat: Add minDigitChars Apr 19, 2025
@will-stone

Copy link
Copy Markdown
Author

Okay, that should be good to go; changed name and rebased onto upstream/main 👍 🙂

@fabian-hiller

fabian-hiller commented Apr 19, 2025

Copy link
Copy Markdown
Member

Thank you so much! It looks good at first glance. I will try to review and merge it soon. Are you also interested in adding maxDigitChars, digitChars and notDigitChars?

@fabian-hiller
fabian-hiller requested a review from Copilot April 19, 2025 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new feature to validate the minimum count of digit characters in a string, improving password validation. Key changes include:

  • Adding a new utility function (_getDigitCount) to count digits in a string.
  • Creating a new minDigitChars action with complete type definitions and overloads.
  • Extending API properties and test coverage to support this new feature.

Reviewed Changes

Copilot reviewed 24 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/src/routes/api/(actions)/minDigitChars/properties.ts Adds API property definitions for the minDigitChars action.
library/src/utils/_getDigitCount/* Implements the _getDigitCount utility along with corresponding tests.
library/src/actions/minDigitChars/minDigitChars.ts Implements the minDigitChars action with overloads and type annotations.
library/src/actions/minDigitChars/.test Provides comprehensive tests and type assertions for the new action.
library/src/actions/index.ts Updates the module exports to include minDigitChars.
Files not reviewed (10)
  • website/src/routes/api/(actions)/minDigitChars/index.mdx: Language not supported
  • website/src/routes/api/(async)/customAsync/index.mdx: Language not supported
  • website/src/routes/api/(async)/fallbackAsync/index.mdx: Language not supported
  • website/src/routes/api/(async)/intersectAsync/index.mdx: Language not supported
  • website/src/routes/api/(async)/lazyAsync/index.mdx: Language not supported
  • website/src/routes/api/(async)/pipeAsync/index.mdx: Language not supported
  • website/src/routes/api/(async)/unionAsync/index.mdx: Language not supported
  • website/src/routes/api/(methods)/config/index.mdx: Language not supported
  • website/src/routes/api/(methods)/fallback/index.mdx: Language not supported
  • website/src/routes/api/(methods)/pipe/index.mdx: Language not supported

@fabian-hiller fabian-hiller added this to the v1.2 milestone Apr 20, 2025
@will-stone

will-stone commented Apr 20, 2025

Copy link
Copy Markdown
Author

I certainly am interested in adding those.

Are there any plans to automate the docs creation? That’s probably the fiddliest part about contributing to this project 😅 I’ve dabbled with typedoc on my personal utility library, Tings, and it works quite nicely. Your setup is more sophisticated as you’re linking pages, but maybe that could go into a JSDoc directive. It would reduce contributor effort, and your review effort massively.

@fabian-hiller

Copy link
Copy Markdown
Member

Unfortunately, our docs creation is currently very manual. But in general it should be possible to automate this process by writing a script to extract all necessary information and automatically generate the required index.mdx and properties.ts files. Just in case you are interested in automating our docs creation, feel free to create another PR with a POC for such a script. I am pretty sure that AI should be able to help write it. Maybe it is somehow possible to extract the necessary type information with a custom TypeScript transformer or plugin or by using tsc somehow. I will be happy to donate $50 to you if we end up implementing your script to automate this workflow, as it would save us all a lot of time.

@muningis

Copy link
Copy Markdown
Contributor

Automation sounds nice, probably would surely make llms.txt easier too.

I just wonder if it would be possible to have those links retained, which links to related schemas/actions/methods.

@fabian-hiller

Copy link
Copy Markdown
Member

I'm not looking for a perfect solution. There will still be a manual part. I am more looking for a CLI script that speeds up the process by generating an initial template with all the info we already know from the source code.

@will-stone

Copy link
Copy Markdown
Author

Thanks @fabian-hiller I'm not sure if I'm going to get the time unfortunately; my time is quite limited these days with family commitments. But if someone else wants to implement this I highly suggest tying it into some custom JSDoc, e.g.

/**
 * Creates a min digits validation action.
 *
 * @param requirement The minimum digits.
 *
 * @returns A min digits action.
 *
 * @schemas any, array, custom, instance, string, tuple, unknown
 * @methods pipe
 * @utils isOfKind, isOfType
 */
export function minDigitChars<

It should get to the point where contributors do not need to touch the docs at all 👍🤓

@fabian-hiller

Copy link
Copy Markdown
Member

That is ok. I am sure someone else will look at it in the long run. For now, I prefer to keep our JSDoc comments simple and don't add extra stuff there. We need a separate JSDoc comment for each TypeScript overload function signature, and adding all that info would force us to duplicate it, which is annoying to maintain.

@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

@will-stone is attempting to deploy a commit to the Open Circle Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Mar 13, 2026
@coderabbitai

coderabbitai Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c691ca06-be5f-45c6-93d2-62253c9a091e

📥 Commits

Reviewing files that changed from the base of the PR and between 204c470 and a4d1dfb.

📒 Files selected for processing (20)
  • .gitignore
  • library/src/actions/index.ts
  • library/src/utils/index.ts
  • website/src/routes/api/(async)/customAsync/index.mdx
  • website/src/routes/api/(async)/fallbackAsync/index.mdx
  • website/src/routes/api/(async)/intersectAsync/index.mdx
  • website/src/routes/api/(async)/lazyAsync/index.mdx
  • website/src/routes/api/(async)/pipeAsync/index.mdx
  • website/src/routes/api/(async)/unionAsync/index.mdx
  • website/src/routes/api/(methods)/config/index.mdx
  • website/src/routes/api/(methods)/fallback/index.mdx
  • website/src/routes/api/(methods)/pipe/index.mdx
  • website/src/routes/api/(schemas)/any/index.mdx
  • website/src/routes/api/(schemas)/custom/index.mdx
  • website/src/routes/api/(schemas)/intersect/index.mdx
  • website/src/routes/api/(schemas)/lazy/index.mdx
  • website/src/routes/api/(schemas)/string/index.mdx
  • website/src/routes/api/(schemas)/union/index.mdx
  • website/src/routes/api/(schemas)/unknown/index.mdx
  • website/src/routes/api/menu.md
🚧 Files skipped from review as they are similar to previous changes (15)
  • library/src/utils/index.ts
  • website/src/routes/api/(schemas)/any/index.mdx
  • website/src/routes/api/(schemas)/custom/index.mdx
  • .gitignore
  • website/src/routes/api/(async)/fallbackAsync/index.mdx
  • library/src/actions/index.ts
  • website/src/routes/api/(schemas)/string/index.mdx
  • website/src/routes/api/(methods)/pipe/index.mdx
  • website/src/routes/api/(schemas)/intersect/index.mdx
  • website/src/routes/api/(async)/unionAsync/index.mdx
  • website/src/routes/api/(schemas)/union/index.mdx
  • website/src/routes/api/(async)/lazyAsync/index.mdx
  • website/src/routes/api/(methods)/config/index.mdx
  • website/src/routes/api/(async)/customAsync/index.mdx
  • website/src/routes/api/(methods)/fallback/index.mdx

Walkthrough

Adds public export wiring and documentation index entries for the minDigitChars validation action, its related types, and the digit-count utility. It also ignores the Vitest temporary TypeScript configuration file and updates action lists across async APIs, methods, schemas, pipelines, and the API menu.

Suggested reviewers: fabian-hiller

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the new minDigitChars validation action.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
library/src/actions/minDigitChars/minDigitChars.ts (1)

22-22: Align the type discriminator with the action name for API consistency.

minDigitChars currently declares/emits type: 'min_digits'. Consider using min_digit_chars so the discriminator follows the same naming pattern as the exported action and future related actions.

♻️ Suggested change
 export interface MinDigitCharsIssue<
@@
-  readonly type: 'min_digits';
+  readonly type: 'min_digit_chars';
@@
 export interface MinDigitCharsAction<
@@
-  readonly type: 'min_digits';
+  readonly type: 'min_digit_chars';
@@
   return {
     kind: 'validation',
-    type: 'min_digits',
+    type: 'min_digit_chars',

Also applies to: 54-54, 117-117

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/actions/minDigitChars/minDigitChars.ts` at line 22, The action's
type discriminator is misnamed as 'min_digits' — update all occurrences of the
readonly property "type" in the minDigitChars action definitions to
'min_digit_chars' so the discriminator matches the exported action name
minDigitChars and the project naming pattern; change each instance (the readonly
type: 'min_digits' declarations at the three spots) and any code that constructs
or matches on that string to use 'min_digit_chars' to keep interface/type checks
and pattern matching consistent.
library/src/actions/minDigitChars/minDigitChars.test.ts (1)

89-95: Decouple expected values from production utility in invalid-case test.

The assertion currently uses _getDigitCount to compute expected received, which can mask defects if the utility regresses.

Suggested test-only adjustment
-      expectActionIssue(
-        action,
-        baseIssue,
-        ['', 'foo', 'abc1234'],
-        (value) => `${_getDigitCount(value)}`
-      );
+      const expectedReceived: Record<string, string> = {
+        '': '0',
+        foo: '0',
+        abc1234: '4',
+      };
+      expectActionIssue(action, baseIssue, ['', 'foo', 'abc1234'], (value) => {
+        return expectedReceived[value];
+      });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@library/src/actions/minDigitChars/minDigitChars.test.ts` around lines 89 -
95, The test "for invalid strings" relies on the production helper
_getDigitCount to compute expected `received` values, which can hide
regressions; update the test that calls expectActionIssue with action and
baseIssue for ['', 'foo', 'abc1234'] to use hard-coded expected strings (e.g.
'0', '0', '4' or whatever the correct expected outputs are) instead of calling
_getDigitCount, so the test asserts fixed expected results and is decoupled from
the production utility.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@website/src/routes/api/`(actions)/minDigitChars/index.mdx:
- Line 53: The example error message for v.minDigitChars is awkward; update the
example call to use clearer, user-friendly wording—e.g., change
v.minDigitChars(2, 'This string must include not 1, but at least 2 digits.') to
a concise message like 'Must contain at least 2 digits' (or similar clear
phrasing) so the v.minDigitChars example reads naturally for end users.

In `@website/src/routes/api/`(types)/MinDigitCharsAction/properties.ts:
- Around line 22-36: Update the href on the MinDigitCharsIssue type reference:
locate the object with name 'MinDigitCharsIssue' (in the properties definition)
and change its href from '../MinDigitCharsAction/' to '../MinDigitCharsIssue/'
so the link points to the correct documentation page for MinDigitCharsIssue.
- Around line 58-72: The BaseValidation generics entry for the custom type
MinDigitCharsIssue currently has an incorrect href pointing to
../MinDigitCharsAction/; update the href for the MinDigitCharsIssue generics
object to ../MinDigitCharsIssue/ so the custom type correctly references the
issue definition (modify the object whose name is 'MinDigitCharsIssue' inside
the generics array to use href: '../MinDigitCharsIssue/').

---

Nitpick comments:
In `@library/src/actions/minDigitChars/minDigitChars.test.ts`:
- Around line 89-95: The test "for invalid strings" relies on the production
helper _getDigitCount to compute expected `received` values, which can hide
regressions; update the test that calls expectActionIssue with action and
baseIssue for ['', 'foo', 'abc1234'] to use hard-coded expected strings (e.g.
'0', '0', '4' or whatever the correct expected outputs are) instead of calling
_getDigitCount, so the test asserts fixed expected results and is decoupled from
the production utility.

In `@library/src/actions/minDigitChars/minDigitChars.ts`:
- Line 22: The action's type discriminator is misnamed as 'min_digits' — update
all occurrences of the readonly property "type" in the minDigitChars action
definitions to 'min_digit_chars' so the discriminator matches the exported
action name minDigitChars and the project naming pattern; change each instance
(the readonly type: 'min_digits' declarations at the three spots) and any code
that constructs or matches on that string to use 'min_digit_chars' to keep
interface/type checks and pattern matching consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d03e0459-1543-4efa-90d6-82ea7a3d965f

📥 Commits

Reviewing files that changed from the base of the PR and between 3430f07 and 79b12a7.

📒 Files selected for processing (34)
  • .gitignore
  • library/src/actions/index.ts
  • library/src/actions/minDigitChars/index.ts
  • library/src/actions/minDigitChars/minDigitChars.test-d.ts
  • library/src/actions/minDigitChars/minDigitChars.test.ts
  • library/src/actions/minDigitChars/minDigitChars.ts
  • library/src/utils/_getDigitCount/_getDigitCount.test.ts
  • library/src/utils/_getDigitCount/_getDigitCount.ts
  • library/src/utils/_getDigitCount/index.ts
  • library/src/utils/index.ts
  • website/src/routes/api/(actions)/minDigitChars/index.mdx
  • website/src/routes/api/(actions)/minDigitChars/properties.ts
  • website/src/routes/api/(async)/customAsync/index.mdx
  • website/src/routes/api/(async)/fallbackAsync/index.mdx
  • website/src/routes/api/(async)/intersectAsync/index.mdx
  • website/src/routes/api/(async)/lazyAsync/index.mdx
  • website/src/routes/api/(async)/pipeAsync/index.mdx
  • website/src/routes/api/(async)/unionAsync/index.mdx
  • website/src/routes/api/(methods)/config/index.mdx
  • website/src/routes/api/(methods)/fallback/index.mdx
  • website/src/routes/api/(methods)/pipe/index.mdx
  • website/src/routes/api/(schemas)/any/index.mdx
  • website/src/routes/api/(schemas)/custom/index.mdx
  • website/src/routes/api/(schemas)/intersect/index.mdx
  • website/src/routes/api/(schemas)/lazy/index.mdx
  • website/src/routes/api/(schemas)/string/index.mdx
  • website/src/routes/api/(schemas)/union/index.mdx
  • website/src/routes/api/(schemas)/unknown/index.mdx
  • website/src/routes/api/(types)/MinDigitCharsAction/index.mdx
  • website/src/routes/api/(types)/MinDigitCharsAction/properties.ts
  • website/src/routes/api/(types)/MinDigitCharsIssue/index.mdx
  • website/src/routes/api/(types)/MinDigitCharsIssue/properties.ts
  • website/src/routes/api/menu.md
  • website/src/routes/guides/(main-concepts)/pipelines/index.mdx

Comment thread website/src/routes/api/(actions)/minDigitChars/index.mdx Outdated
Comment on lines +22 to +36
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Incorrect href for MinDigitCharsIssue reference.

The MinDigitCharsIssue type should link to ../MinDigitCharsIssue/ rather than ../MinDigitCharsAction/. This will result in incorrect navigation when users click on the MinDigitCharsIssue link in the documentation.

🔧 Proposed fix
             {
               type: 'custom',
               name: 'MinDigitCharsIssue',
-              href: '../MinDigitCharsAction/',
+              href: '../MinDigitCharsIssue/',
               generics: [
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsIssue/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/routes/api/`(types)/MinDigitCharsAction/properties.ts around
lines 22 - 36, Update the href on the MinDigitCharsIssue type reference: locate
the object with name 'MinDigitCharsIssue' (in the properties definition) and
change its href from '../MinDigitCharsAction/' to '../MinDigitCharsIssue/' so
the link points to the correct documentation page for MinDigitCharsIssue.

Comment on lines +58 to +72
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Same href issue for MinDigitCharsIssue in BaseValidation generics.

The MinDigitCharsIssue reference in the BaseValidation generics also incorrectly links to ../MinDigitCharsAction/ instead of ../MinDigitCharsIssue/.

🔧 Proposed fix
         {
           type: 'custom',
           name: 'MinDigitCharsIssue',
-          href: '../MinDigitCharsAction/',
+          href: '../MinDigitCharsIssue/',
           generics: [
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsIssue/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@website/src/routes/api/`(types)/MinDigitCharsAction/properties.ts around
lines 58 - 72, The BaseValidation generics entry for the custom type
MinDigitCharsIssue currently has an incorrect href pointing to
../MinDigitCharsAction/; update the href for the MinDigitCharsIssue generics
object to ../MinDigitCharsIssue/ so the custom type correctly references the
issue definition (modify the object whose name is 'MinDigitCharsIssue' inside
the generics array to use href: '../MinDigitCharsIssue/').

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@fabian-hiller
fabian-hiller requested a review from Copilot March 13, 2026 17:41
@fabian-hiller

Copy link
Copy Markdown
Member

Sorry for the delay. I try to catch up in the next few weeks.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +73 to +85
/**
* Creates a min digits validation action.
*
* @param requirement The minimum digits.
*
* @returns A min digits action.
*/
export function minDigitChars<
TInput extends string,
const TRequirement extends number,
>(
requirement: TRequirement
): MinDigitCharsAction<TInput, TRequirement, undefined>;
*/
// @__NO_SIDE_EFFECTS__
export function _getDigitCount(input: string): number {
return (input.match(/\d/gu) || []).length;
Comment on lines +18 to +36
type: 'custom',
name: 'ErrorMessage',
href: '../ErrorMessage/',
generics: [
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
Comment on lines +43 to +74
BaseValidation: {
modifier: 'extends',
type: {
type: 'custom',
name: 'BaseValidation',
href: '../BaseValidation/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'MinDigitCharsIssue',
href: '../MinDigitCharsAction/',
generics: [
{
type: 'custom',
name: 'TInput',
},
{
type: 'custom',
name: 'TRequirement',
},
],
},
],
},
Comment on lines 63 to +64
export * from './minEntries/index.ts';
export * from './minDigitChars/index.ts';
@yslpn

yslpn commented Jul 26, 2026

Copy link
Copy Markdown
Member

@will-stone Hi. Are you interested in further developing this pull request to bring it to a merge? If so, I'll review it.

Unfortunately, I don't think we can release just minDigitChars; the API needs to be symmetrical.

@yslpn yslpn self-assigned this Jul 26, 2026
@will-stone

Copy link
Copy Markdown
Author

Hi @yslpn Ah, sorry! I've not had much time to review this. I'm more than happy if someone else would like to take the reins or close this off for a future time. Apologies I was unable to finish it.

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

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files. workaround Workaround fixes problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants