Skip to content

Commit

Permalink
[typeid] Add support for spec 0.3 (underscores in type) (#318)
Browse files Browse the repository at this point in the history
## Summary
TSIA

## How was it tested?
Added newest spec tests and they all pass
  • Loading branch information
loreto committed Apr 15, 2024
1 parent 26a84e8 commit 5ffabce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Latest spec version: v0.3.0

| Language | Status | Spec Version |
| ----------------------------------------------------- | ------------- | ------------ |
| [Go](https://github.com/jetify-com/typeid-go) | ✓ Implemented | v0.2 |
| [Go](https://github.com/jetify-com/typeid-go) | ✓ Implemented | v0.3 |
| [SQL](https://github.com/jetify-com/typeid-sql) | ✓ Implemented | v0.2 |
| [TypeScript](https://github.com/jetify-com/typeid-js) | ✓ Implemented | v0.2 |

Expand Down
6 changes: 3 additions & 3 deletions spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ The prefix must:
- Contain at most 63 characters.
- May be empty.
- If not empty:
* Must contain only lowercase alphabetic ASCII characters `[a-z]`, or an underscore `_`.
* Must start and end with an alphabetic character `[a-z]`. Underscores are not allowed at the beginning or end of the string.
- Must contain only lowercase alphabetic ASCII characters `[a-z]`, or an underscore `_`.
- Must start and end with an alphabetic character `[a-z]`. Underscores are not allowed at the beginning or end of the string.

Valid prefixes match the following
regex: `^([a-z]([a-z_]*[a-z])?)?$`.
regex: `^([a-z]([a-z_]{0,61}[a-z])?)?$`.

The empty string is a valid prefix, it's there for use cases in which
applications need to encode a typeid but elide the type information. In general though,
Expand Down

0 comments on commit 5ffabce

Please sign in to comment.