dndb
dndb copied to clipboard
incorrectly handled async functions
I believe this async section is handled incorrectly:
https://github.com/denyncrawford/dndb/blob/main/src/methods/insert.js#L6
I get un awaited async issues in tests and race conditions for deleting the used file to clean up.
I've done some research and it seems that swallowing the async promises using forEach is risky.
I think it would be better to do await Promise.all(data.map(async e => ....)) or some variation.