-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
improve(core): enhance code quality with better error handling and docs.. #10893
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
Open
dollaransh17
wants to merge
1
commit into
NativeScript:main
Choose a base branch
from
dollaransh17:improve/code-quality-enhancements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
improve(core): enhance code quality with better error handling and docs.. #10893
dollaransh17
wants to merge
1
commit into
NativeScript:main
from
dollaransh17:improve/code-quality-enhancements
Conversation
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
…cumentation - Add comprehensive JSDoc documentation for helper functions in application/helpers-common.ts - Improve error handling in Android native app initialization with try-catch block - Resolve TODO comment about custom application type handling - Enhance timeConverter function with input validation and better error messages - Improve cubic-bezier animation error message with detailed format expectations - Add proper return type annotations for background state functions - Better developer warnings when reflection fails during app initialization These improvements enhance code maintainability, provide better developer experience, and make error messages more actionable for debugging.
| export function timeConverter(value: string): number { | ||
| let result = parseFloat(value); | ||
| if (!value || typeof value !== 'string') { | ||
| throw new Error(`Invalid time value: '${value}'. Expected a string with time value.`); |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| throw new Error(`Invalid time value: '${value}'. Expected a string with time value.`); | |
| console.warn(`Invalid time value: '${value}'. Expected a string with time value.`); |
we avoid unnecessary throw in core.
|
|
||
| const numericValue = parseFloat(value); | ||
| if (isNaN(numericValue)) { | ||
| throw new Error(`Invalid time value: '${value}'. Expected a numeric value with optional 's' or 'ms' unit.`); |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
| throw new Error(`Invalid time value: '${value}'. Expected a numeric value with optional 's' or 'ms' unit.`); | |
| console.warn(`Invalid time value: '${value}'. Expected a numeric value with optional 's' or 'ms' unit.`); |
Suggested change
| throw new Error(`Invalid time value: '${value}'. Expected a numeric value with optional 's' or 'ms' unit.`); | |
| console.warn(`Invalid time value: '${value}'. Expected a string with time value.`); |
we avoid unnecessary throw in core.
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.
These improvements enhance code maintainability, provide better developer experience, and make error messages more actionable for debugging.
PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].