BCF.js
BCF.js copied to clipboard
The data returned by getHeaderFiles does not matche the return type
According to the return type of getHeaderFiles here , the function should return IFile[] | undefined.
However, based on my debugging, it actually returns { file: IFile }[] | undefined which will result in runtime errors in library user's code.
As a workaround, I have to run
markup.header.files = (markup.header.files).map((f: any) => f.file); for each markup to get the expected behavior.
Yeah I've noticed types are wrong in a few places. I ended up patching all the ones I ran into locally. If I have some time I'll try and put up a PR for this.