But when I try to apply this adapter with commitizen I got the error in the title.
When I transformed my exported function to non-async, but using "().then()" it was resolved
The reason is, when exporting such thing, its type is: [object AsyncFunction]
However, commitizen will emit error.
Because: https://github.com/commitizen/cz-cli/blob/master/src/common/util.js
line 41: return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
This should be:
I created my own adapter for commitizen. At first, I built the adapter using TSC. The problem is that I export an async function:
But when I try to apply this adapter with commitizen I got the error in the title. When I transformed my exported function to non-async, but using "().then()" it was resolved
The reason is, when exporting such thing, its type is:
[object AsyncFunction]
However, commitizen will emit error. Because: https://github.com/commitizen/cz-cli/blob/master/src/common/util.js line 41:return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
This should be:return functionToCheck && (getType.toString.call(functionToCheck) === '[object Function]' || getType.toString.call(functionToCheck) === '[object AsyncFunction]');