There is an issue with map generator create methods requiring a callback even if the usage doesn't require it.
Current Behavior
Attempting to call the create method of the Cellular map generate (and others, it looks like) will cause an error.
const generator = new Cellular(width, height)
generator.create() // Expected 1 arguments, but got 0. An argument for 'callback' was not provided.
// have to put in an empty callback to make it work
generator.create(() => {}) // not ideal, and tslint complains
I found this on the Cellular map but it appears to be a problem in other cases. I don't know the full extent or I would submit a PR for it. I believe it's an easy fix, though. Here is the relevant code:
There is an issue with map generator
create
methods requiring a callback even if the usage doesn't require it.Current Behavior
Attempting to call the
create
method of the Cellular map generate (and others, it looks like) will cause an error.I found this on the Cellular map but it appears to be a problem in other cases. I don't know the full extent or I would submit a PR for it. I believe it's an easy fix, though. Here is the relevant code:
https://github.com/ondras/rot.js/blob/754d7967aec6af5cefdce70fab8e70de05df41d3/src/map/cellular.ts#L65
Expected Behavior
It appears that according to the docs and the code (and my own experiments), this parameter is not required.
I believe that this method (and other
CreateCallback
) should be defined asThe code already correctly checks the presence of the value, so I don't think any other changes are required to fix this.