imgly / background-removal-js

Remove backgrounds from images directly in the browser environment with ease and no additional costs or privacy concerns. Explore an interactive demo.
https://img.ly/showcases/cesdk/web/background-removal/web
GNU Affero General Public License v3.0
5.49k stars 339 forks source link

Fix return type of the progress function #79

Closed maerch closed 7 months ago

maerch commented 7 months ago

In user code, the return type undefined() from the progress callback causes a TypeScript error Type void is not assignable to type undefined. To avoid this error the user has to explicitly return undefined; in their progress implementation which does not make much sense.

This PR changes undefined() to void() to avoid this TS error.

Also, I've added an optional ? in the changelog create script to have a better error message if a user forgets to provide the changelog name as an argument. Without it, it will try to call replace on undefined with a not very helpful error message.