Subclassing FileAttachment for parsing fileInput

There is problem with File Input with Initial Value / Mike Bostock / Observable that if user selects own file, it is no longer possible to use .csv method to parse it, because the returned type would be File that doesn’t have these methods.

So I thought that maybe I can make some wrapper around AbstractFile from stdlib/fileAttachment.js at e520f0db489e6c524baa2b2bdef267e19ef7c596 · observablehq/stdlib · GitHub that takes File as an argumetn, but I can not understand how to import that.

Maybe it is already a solved problem, or there is a better solution to that?

yeah

3 Likes