javascript icon indicating copy to clipboard operation
javascript copied to clipboard

fix(incrementBase32): fix error message when unable to increment the input

Open kt3k opened this issue 2 years ago • 0 comments

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.

kt3k avatar Aug 04 '23 07:08 kt3k