-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
File support #102
Comments
This seems to be because of Node's structuredClone function works. More minimal example: const file = new File([
'hello world!'
], 'file.txt');
console.log(Object.getPrototypeOf(file));
console.log(Object.getPrototypeOf(structuredClone(file))); If you run that in Node, you see the 2nd log is just a Blob rather than a File, but if you run it in a web browser then both are Files. fake-indexeddb internally uses structuredClone from Node, which does work very similar to the web browser version which is used in the IndexedDB spec, but IIRC there are some minor differences and I guess this is one. Whether this is a bug in Node or it's intended behavior, I'm not sure, I haven't had a chance to investigate further. |
This issue in the Node repo suggests that it may be a Node bug. |
fake-indexeddb
seems to support the storage of blobs (#56); however, if one attempts to store aFile
, then the file, when retrieved, will be converted into aBlob
, and part of its information, such as file name, will be lost.Example:
The text was updated successfully, but these errors were encountered: