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(useBase64): accept objects #1706

Merged
merged 5 commits into from Jul 6, 2022
Merged

Conversation

chaii3
Copy link
Contributor

@chaii3 chaii3 commented Jun 19, 2022

Description

Allow to add objects in useBase64

fixes #1677

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

// undefined or null
if (_target === undefined || _target === null) { resolve('') }
// undefined
if (_target === undefined) { resolve('') }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason that null is being excluded here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more obvious if we check all cases for typeof _target === 'object' in one place. I check this one in getDefaultSerialization but I'm not really sure this decision.

@antfu antfu changed the title feat: added functionality for objects in useBase64 feat(useBase64): accept objects Jun 21, 2022
@chaii3 chaii3 requested a review from antfu June 21, 2022 14:07
@antfu antfu merged commit 1fd3496 into vueuse:main Jul 6, 2022
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.

Allow useBase64 to take an object
2 participants