-
Notifications
You must be signed in to change notification settings - Fork 68
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: improve data parsing for unstorage #204
Merged
Merged
Conversation
This file contains 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
Aareksio
changed the title
fix(unstorage): actually implement unstorage driver
feat(unstorage): improve data parsing
Jan 6, 2024
8 tasks
pi0
changed the title
feat(unstorage): improve data parsing
fix: improve data parsing for unstorage
Jan 11, 2024
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 50.73% 53.66% +2.93%
==========================================
Files 14 14
Lines 1157 1187 +30
Branches 48 66 +18
==========================================
+ Hits 587 637 +50
+ Misses 567 547 -20
Partials 3 3 β View full report in Codecov by Sentry. |
pi0
approved these changes
Jan 11, 2024
Thanks! |
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.
π Linked issue
nuxt/image#1177
β Type of change
π Description
The
prefix
should not be required.unstorage
is not opinionated about what data type shouldgetItem
/getItemRaw
return (unjs/unstorage#142). This making creating generic wrapper a bit complicated. Sinceipx
requires the data to be aBuffer
, I've added a simple parse attempt in order to normalize error for unsupported storages. The common return data types should be covered:ArrayBuffer
,Buffer
,String
andBlob
.I also found some inconsistencies in
unstorage
drivers, namely http driver throws 404 when a file is not found, instead of returningnull
which seems to beunstorage
convention. This breaks the test. I classify this as a bug in unstorage and keep the test disabled. RunTEST_UNSTORAGE_HTTP=true pnpm test
to see the error.π Checklist
Unstorage support is not documented yet