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: Enhance URL query parsing functions #80

Merged
merged 4 commits into from
Dec 18, 2024
Merged

feat: Enhance URL query parsing functions #80

merged 4 commits into from
Dec 18, 2024

Conversation

iugo
Copy link
Member

@iugo iugo commented Dec 18, 2024

feat: 完善 URL query 解析相关函数功能

iugo added 4 commits December 18, 2024 12:51
- Updated the parseQueryString function to return undefined instead of null for null inputs, improving consistency in return values.
- Introduced parseQueryStringArray function to convert URL query parameter values into an array of strings, with error handling for invalid inputs.
- Added parseQueryPositiveInts function to convert query parameter values into an array of positive integers, including robust error handling and type safety.
- Enhanced documentation with detailed JSDoc comments for new functions, clarifying parameters, return values, and error handling scenarios.
- Updated parseQueryString, parseQueryStringArray, parseQueryNumber, parseQueryInt, and parseQueryPositiveInt functions to improve handling of null, undefined, and invalid inputs.
- Added comprehensive JSDoc comments in both English and Chinese for all functions, clarifying parameters, return values, and error handling scenarios.
- Introduced examples for each function to demonstrate usage and expected outcomes, enhancing overall documentation quality.
- Introduced a new module `url-parse.ts` with functions for parsing URL query parameters, including `parseQueryString`, `parseQueryStringArray`, `parseQueryNumber`, `parseQueryInt`, and `parseQueryPositiveInt`.
- Added comprehensive JSDoc documentation in both English and Chinese, detailing function parameters, return values, and error handling.
- Created unit tests in `url-parse.test.ts` to validate the functionality of the new parsing methods, ensuring robust handling of various input scenarios.
- Updated `deno.json` to include the new `url-parse` module, enhancing the project's overall functionality.
- Added new parsing functions: `parseQueryInt`, `parseQueryNumber`, `parseQueryPositiveInts`, and `parseQueryStringArray` to enhance query parameter handling.
- Updated existing tests for `parseQueryPositiveInt` to improve error handling and consistency in return values.
- Introduced comprehensive unit tests for the new functions, ensuring robust validation of various input scenarios.
- Enhanced overall test coverage for URL query parameter parsing functionality.
@iugo iugo self-assigned this Dec 18, 2024
@iugo iugo merged commit 92281ed into main Dec 18, 2024
1 check passed
@iugo iugo deleted the feat-url-type branch December 18, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant