-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: WrappedValue.unwrap empty string behavior #6900
Conversation
Currently: ``` var value = new WrappedValue('') // passing empty string console.log(WrappedValue.unwrap(value) === '' ) // prints "false" ``` Now: ``` var value = new WrappedValue('') // passing empty string console.log(WrappedValue.unwrap(value) === '' ) // prints "true" ```
@speigg there are failing unit tests with this change:
You can run the unit tests locally like this: cd tests
tns run android |
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.
As @manoldonev pointed out - the proposed solution fails when unwrap
is given a boolean value.
Lets just make an instanceof
check:
return (value instanceof WrappedValue) ? value.wrapped : value;
Also, can you add some unit-tests about this case. You can check this guide on how to do that.
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
@manoldonev thanks for taking care of this, I haven't had time to work on this myself |
test |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Currently:
Now:
PR Checklist
What is the current behavior?
What is the new behavior?
Fixes/Implements/Closes #[Issue Number].