javascript
javascript copied to clipboard
fix(incrementBase32): fix error message when unable to increment the input
Currently the below errors with Error: incorrectly encoded string:
const ULID = require('ulid')
ULID.incrementBase32('ZZZ')
However, the error message seems wrong here because ZZZ is correctly encoded base32 string. I think the error message should be cannot increment this string here. This PR fixes this issue by incrementing index counter before comparing with >=0.