You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use this package in a project, but I wanted to use lowercased letters instead, so I used the string "abcdefghijkmnpqrstuvwxyz23456789" instead (removing the characters "l10o"). I was using the isValid call to in a test to check that a field was being filled with a valid value, but apparently, isValid is resetting the characters to the original string and checking against that, failing the current isValid check and causing any further use of generate() to use the originally capitalized string.
Here is an example of what I'm seeing, starting node from the root of the project:
varshortid32=require(".");shortid32.characters("abcdefghijkmnpqrstuvwxyz23456789");varid=shortid32.generate();console.log(id);// Should return something like 'yhzz6ad9z'varcheck=shortid32.isValid(id);console.log(check);// Returns false!console.log(shortid32.characters());// Returns something like 'DPZNKTVGCAX9J5WUMFRYHE4LS236Q78B'!!id=shortid32.generate();console.log(id);// Returns something like 'VMRLUQ78K'!
I'll just leave this validity check out in my tests and just do a basic "is string" check, but just wanted to put a heads up on this very unexpected behavior.
The text was updated successfully, but these errors were encountered:
I'm trying to use this package in a project, but I wanted to use lowercased letters instead, so I used the string "abcdefghijkmnpqrstuvwxyz23456789" instead (removing the characters "l10o"). I was using the isValid call to in a test to check that a field was being filled with a valid value, but apparently, isValid is resetting the characters to the original string and checking against that, failing the current isValid check and causing any further use of generate() to use the originally capitalized string.
Here is an example of what I'm seeing, starting node from the root of the project:
I'll just leave this validity check out in my tests and just do a basic "is string" check, but just wanted to put a heads up on this very unexpected behavior.
The text was updated successfully, but these errors were encountered: