From 57b319273c741cd5f6053b0ff1055971b3ea6cce Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 1 May 2020 23:52:01 +0800 Subject: [PATCH] feat(napi): impl get_value for Boolean --- napi/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/napi/src/lib.rs b/napi/src/lib.rs index 1f99ab99..36acb931 100644 --- a/napi/src/lib.rs +++ b/napi/src/lib.rs @@ -780,6 +780,12 @@ fn get_raw_type(env: sys::napi_env, raw_value: sys::napi_value) -> sys::napi_val } } +impl<'env> Value<'env, Boolean> { + pub fn get_value(&self) -> bool { + self.value.value + } +} + impl<'env> Value<'env, JsString> { pub fn len(&self) -> Result { let mut raw_length = ptr::null_mut();