mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
15 lines
249 B
Rust
15 lines
249 B
Rust
use napi::bindgen_prelude::*;
|
|
|
|
#[napi]
|
|
fn list_obj_keys(obj: Object) -> Vec<String> {
|
|
Object::keys(&obj).unwrap()
|
|
}
|
|
|
|
#[napi]
|
|
fn create_obj(env: Env) -> Object {
|
|
let mut obj = env.create_object().unwrap();
|
|
obj.set("test", 1).unwrap();
|
|
|
|
obj
|
|
}
|