dylanhart / ulid-rs

This is a Rust implementation of the ulid project
https://crates.io/crates/ulid
MIT License
381 stars 36 forks source link

Add JS/Wasm compatibility (using the wasm-timer crate) #62

Closed jakubadamw closed 1 year ago

jakubadamw commented 1 year ago

As it is, this package does not work with the wasm32-unknown-unknown target. This adds support for it by bringing in an optional dependency on wasm-timer that implements an equivalent of the SystemTime type using JS's DateTime.now() under the hood. This PR also adds a js feature that will enable said support. This is similar to what the uuid package does.