singerla / pptx-automizer

A template based pptx generator for Node.js
MIT License
68 stars 12 forks source link

fixed issues where a full byte array could be logged to the console. #111

Closed mikemeerschaert closed 3 months ago

mikemeerschaert commented 3 months ago

This is related to #109, I noticed that the byte array was being logged to the console in the xml relationship helper, but the reason it was happening was concerning because sourceArchive.filename was typed as a string and I didn't know where else this might come up. The issue is the Archive base class accepted filename without a type, so while implementing #109 super was called which assigns the buffer to filename, then it's treated as a string elsewhere in code.

This PR explicitly types the Archive constructor arg as AutomizerFile, and I updated the places where filename is referenced to ensure it gets treated correctly depending on it's type. Note that the ArchiveFS is unchanged and still treats filename like a string as it won't be invoked with the buffer.

singerla commented 3 months ago

Thanks a lot again for your contribution!