jetify-com / typeid

Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
Apache License 2.0
2.92k stars 38 forks source link

Add Typescript Implementation #3

Closed ongteckwu closed 1 year ago

ongteckwu commented 1 year ago

Implemented a typescript implementation. Needed for my work. Will post here soon after I polish it up. Thanks for this project!

ongteckwu commented 1 year ago

https://github.com/ongteckwu/typeid-ts heres the typescript implementation. It includes both a cli tool and a lib. You can do npm install typeid-ts or with -g for cli tool to use it straight away :)

izakfilmalter commented 1 year ago

Wow that was fast. I'm thinking about converting my app to this from UUID.

loreto commented 1 year ago

@ongteckwu Thanks so much for contributing.

I've gone ahead and added your implementation to the list of implementations under: https://github.com/jetpack-io/typeid#community-provided-implementations

You'll notice I have a "Validated Against Spec" column in the table. I recently added a bunch of tests for the go implementation here: https://github.com/jetpack-io/typeid-go/blob/main/typeid_test.go

If you add the same tests and show that your implementation passes, I'll go ahead and mark it as validated.

Also, as a heads up, I too had a TypeScript implementation in the works (unfortunately we wrote them in parallel), which I also added to the list. If you are open to it, we can discuss how to merge the two implementations!

ongteckwu commented 1 year ago

@loreto very nice. Okay I will add the tests when I have the time. Thank you!

ongteckwu commented 1 year ago

@loreto I added the tests! =D

loreto commented 1 year ago

Amazing, send me a PR against this file https://github.com/jetpack-io/opensource/blob/main/typeid/typeid/README.md (in our opensource monorepo) marking your implementation as validated.

Add Yes, on 2023-06-30 to the corresponding cell in the table.