Skip to content

Commit

Permalink
js(nostr): add JsKind::_to_string method
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Oct 9, 2024
1 parent 882278c commit 736c717
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* ffi(nostr): add `tag_kind_to_string` func ([Yuki Kishimoto])
* ffi(nostr): add `Tag::kind_str` method ([Yuki Kishimoto])
* ffi(nostr): impl `Display` for `Kind` ([Yuki Kishimoto])
* js(nostr): add `JsKind::_to_string` method ([Yuki Kishimoto])
* book: add some examples ([RydalWater])

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions bindings/nostr-js/src/event/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ impl JsKind {
self.inner.as_u16()
}

#[wasm_bindgen(js_name = toString)]
pub fn _to_string(&self) -> String {
self.inner.to_string()
}

/// Check if it's regular
///
/// Regular means that event is expected to be stored by relays.
Expand Down

0 comments on commit 736c717

Please sign in to comment.