Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add MIN_ULID and MAX_ULID constants #30

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

bradvogel
Copy link
Contributor

Exports new constants MIN_ULID and MAX_ULID. These can be useful when doing range queries to look for valid ULIDs, eg

id > `${ULID.MIN_ULID} AND id < `${ULID.MAX_ULID}

Note: this was also submitted as a PR to the official, yet unmaintained, repo: ulid/javascript#107

@perry-mitchell
Copy link
Owner

Looks good! Thanks for this. It'll go out tonight.

@perry-mitchell perry-mitchell merged commit c0ed4de into perry-mitchell:main Oct 8, 2023
5 checks passed
@perry-mitchell
Copy link
Owner

Good to note here, however, that using these in a range is not entirely sufficient in testing validity. The isValid method should be solely used for that purpose.

If 100% confidence isn't necessary (quick validation or comparison) then this would otherwise be acceptable imo.

@bradvogel
Copy link
Contributor Author

@perry-mitchell Thanks!

@bradvogel
Copy link
Contributor Author

@perry-mitchell Will you release a new version soon?

@bradvogel bradvogel deleted the add-constants branch October 9, 2023 21:49
@perry-mitchell
Copy link
Owner

Released 2.2.0 just now @bradvogel :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants