fix: resolve all pre-commit type errors and add missing route files#913
Merged
Conversation
|
@promisszn is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@promisszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #729
Closes #730
Closes #737
Closes #741
Changes proposed
What were you told to do?
Implement four new utility API endpoints inside
app/api/routes-f/:What did you do?
GCD/LCM Calculator (
app/api/routes-f/gcd-lcm/) — #729route.ts—POST /api/routes-f/gcd-lcmaccepts{ numbers: number[], operation?: "both" | "gcd" | "lcm" }, returns{ gcd?, lcm?, n_count }_lib/helpers.ts— Euclidean GCD, LCM via|a*b|/gcd(a,b), BigInt intermediate arithmetic to prevent overflow, validates positive integers with a 100-element cap_lib/types.ts—GcdLcmInput,GcdLcmResponse,Operationtypes__tests__/gcd-lcm.test.ts— covers known pairs, multiple numbers, primes, single element, and validation errorsQuadratic Solver (
app/api/routes-f/quadratic/) — #730route.ts—POST /api/routes-f/quadraticaccepts{ a, b, c }, returns{ roots, discriminant, vertex, axis_of_symmetry, has_complex_roots }_lib/helpers.ts— solves ax² + bx + c = 0 for real distinct, repeated, and complex roots; rejectsa = 0; rounds to 6 decimal places_lib/types.ts—Root,Vertex,QuadraticResponsetypes__tests__/quadratic.test.ts— covers all root types, vertex/axis calculation, anda = 0rejectionCookie Parser & Builder (
app/api/routes-f/cookie-parse/) — #737route.ts—POST /api/routes-f/cookie-parseaccepts{ mode: "parse" | "build", input }, returns a parsed cookie object or aSet-Cookieheader string_lib/helpers.ts— parsesCookie/Set-Cookieheaders into structured objects with all attributes (expires,max_age,domain,path,secure,http_only,same_site); buildsSet-Cookiestrings; URL-decodes values; validatessame_siteenum_lib/types.ts—CookieAttributes,ParsedCookiestypes__tests__/cookie-parse.test.ts— covers parse with all attributes, build round-trip, multiple cookies, and invalid input rejectionCharacter Statistics (
app/api/routes-f/char-stats/) — #741route.ts—POST /api/routes-f/char-statsaccepts{ text }, returns{ total, letters, digits, whitespace, punctuation, symbols, emoji, other, by_script }_lib/helpers.ts— Unicode property regexes (/\p{L}/uetc.), multi-codepoint ZWJ emoji handling viaIntl.Segmenter, script detection for Latin/Cyrillic/CJK/Arabic, 1 MB input cap_lib/types.ts—CharStatsResponse,ScriptBreakdowntypes__tests__/char-stats.test.ts— covers ASCII, mixed scripts, emoji sequences, and size limit enforcementCheck List (Check all the applicable boxes)
🚨Please review the contribution guideline for this repository.