napi-rs/test_module/src/napi5/date.rs

8 lines
220 B
Rust
Raw Normal View History

use napi::{CallContext, JsBoolean, JsUnknown, Result};
#[js_function(1)]
pub fn test_object_is_date(ctx: CallContext) -> Result<JsBoolean> {
let obj = ctx.get::<JsUnknown>(0)?;
ctx.env.get_boolean(obj.is_date()?)
}