feat: add lowercase validation action#1511
Conversation
|
Someone is attempting to deploy a commit to the Open Circle Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughA new 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
website/src/routes/api/(actions)/lowercase/index.mdx (1)
29-31: ⚡ Quick winClarify the validation behavior in the explanation.
The current wording "If the string does not contain only lowercase characters" could be misinterpreted. According to the PR summary, the validation uses
/^[^A-Z]*$/uwhich checks for the absence of uppercase ASCII characters, not the presence of only lowercase letters. This means numbers, special characters, and non-ASCII characters are permitted.Consider rewording to: "With
lowercaseyou can validate that a string contains no uppercase characters. If the input contains uppercase characters, you can usemessageto customize the error message."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@website/src/routes/api/`(actions)/lowercase/index.mdx around lines 29 - 31, Update the explanation section in the documentation to clarify the actual validation behavior. Replace the phrase "If the string does not contain only lowercase characters" with wording that accurately describes the validation pattern's behavior: that it validates a string contains no uppercase ASCII characters. The clarification should convey that numbers, special characters, and non-ASCII characters are permitted by the validation, not rejected as the current wording implies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@website/src/routes/api/`(actions)/lowercase/index.mdx:
- Around line 29-31: Update the explanation section in the documentation to
clarify the actual validation behavior. Replace the phrase "If the string does
not contain only lowercase characters" with wording that accurately describes
the validation pattern's behavior: that it validates a string contains no
uppercase ASCII characters. The clarification should convey that numbers,
special characters, and non-ASCII characters are permitted by the validation,
not rejected as the current wording implies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8c1ed8b7-e757-4991-b57e-0b9dadade3a1
📒 Files selected for processing (13)
library/src/actions/index.tslibrary/src/actions/lowercase/index.tslibrary/src/actions/lowercase/lowercase.test-d.tslibrary/src/actions/lowercase/lowercase.test.tslibrary/src/actions/lowercase/lowercase.tslibrary/src/regex.tswebsite/src/routes/api/(actions)/lowercase/index.mdxwebsite/src/routes/api/(actions)/lowercase/properties.tswebsite/src/routes/api/(types)/LowercaseAction/index.mdxwebsite/src/routes/api/(types)/LowercaseAction/properties.tswebsite/src/routes/api/(types)/LowercaseIssue/index.mdxwebsite/src/routes/api/(types)/LowercaseIssue/properties.tswebsite/src/routes/api/menu.md
There was a problem hiding this comment.
1 issue found across 13 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="website/src/routes/api/(actions)/lowercase/index.mdx">
<violation number="1" location="website/src/routes/api/(actions)/lowercase/index.mdx:31">
P2: Documentation overstates `lowercase` validation behavior by describing it as checking that a string 'is lowercase' / contains 'only lowercase characters', but the actual regex `/^[^A-Z]*$/u` only excludes ASCII uppercase letters A-Z. Unicode uppercase characters like `Ä` would still pass validation, creating a semantic mismatch.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Summary
Add a
lowercasevalidation action that validates a string contains no uppercase ASCII characters. This complements the existingtoLowerCasetransform action.Changes
Library
library/src/regex.ts— AddedLOWERCASE_REGEX(/^[^A-Z]*$/u)library/src/actions/lowercase/lowercase.ts— Newlowercaseaction implementationlibrary/src/actions/lowercase/index.ts— Barrel exportlibrary/src/actions/lowercase/lowercase.test.ts— 11 unit testslibrary/src/actions/lowercase/lowercase.test-d.ts— 6 type testslibrary/src/actions/index.ts— Added export lineWebsite
(actions)/lowercase/— New API reference page for the action(types)/LowercaseAction/— New type documentation page(types)/LowercaseIssue/— New issue type documentation pagemenu.md— Added menu entriesTesting
Checklist
digits,emoji,finite)Summary by cubic
Add a
lowercasevalidation action that fails when a string includes any uppercase ASCII letters. Complements the existingtoLowerCasetransform and includes docs, tests, and menu updates.lowercase(message?)validation usingLOWERCASE_REGEX(/^[^A-Z]*$/u), issuingLowercaseIssueon failure.library/src/actions/index.ts; new typesLowercaseActionandLowercaseIssue.Written for commit 0c68dd4. Summary will update on new commits.