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

Created a File Class #97

Merged
merged 8 commits into from
May 29, 2021
Merged

Created a File Class #97

merged 8 commits into from
May 29, 2021

Conversation

jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented May 28, 2021

I got two packages that would very much need a File class, I know @octet-stream could need one as well. I added it as a separate file (file.js) that also extends the Blob class.
Therefore i have also added the fileFrom and fileFromAsync methods to from.js as well

I also added the option to pass in a mimetype in in all 4 methods so it can set the type on the blob/file so it dosen't have to be wrapped again in a new blob or file

closes #91


I also took the opportunity to extract the DOMException from NodeJS itself and removed the dependency on DOMException package

closes #96


Also updated all dependencies and fixed the new lint rules by xo

closes #95

@codecov
Copy link

codecov bot commented May 28, 2021

Codecov Report

Merging #97 (b5fa0bd) into master (8ef89ad) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #97   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         3    +1     
  Lines          289       350   +61     
  Branches        44        51    +7     
=========================================
+ Hits           289       350   +61     
Impacted Files Coverage Δ
file.js 100.00% <100.00%> (ø)
from.js 100.00% <100.00%> (ø)
index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ef89ad...b5fa0bd. Read the comment docs.

from.js Show resolved Hide resolved
from.js Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
file.js Outdated Show resolved Hide resolved
File.d.ts Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
...not worth the effort
Copy link
Contributor

@octet-stream octet-stream left a comment

Choose a reason for hiding this comment

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

LGTM

@jimmywarting jimmywarting merged commit 8d14e88 into node-fetch:master May 29, 2021
@jimmywarting jimmywarting deleted the file-class branch May 29, 2021 09:17
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.

Revisit DOMException Adding a File class maybe?
2 participants