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: Add extension for creating data from data url #3474

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

jcesarmobile
Copy link
Member

This allows plugins to create Data from both a base64 string (i.e. SGVsbG8sIFdvcmxkIQ==) or a base64 encoded url (i.e. data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==)
Current Data(base64Encoded: base64string)only allows the first, but fails with the second and there are a few plugins that accept both.
Instead of using the getCleanData that strips the data part from the string, and then converts it to Data, this handles both things on a single call.
To be used like Data.capacitor.data(base64EncodedOrDataUrl: dataStringFromPlugin)

@jcesarmobile jcesarmobile merged commit 2909fd0 into main Aug 27, 2020
@jcesarmobile jcesarmobile deleted the data-from-dataurl branch August 27, 2020 16:02
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.

None yet

2 participants