Macro improvements
- Document how to use
serde_bytes::ByteBuf with node Buffers
- Allow docs and other attributes on functions in export macro
- add
#[allow(snake_case)] added by default in export macro
- Better behaviour for
Option<T> in export macro
...
export! {
/// Adding docs and attributes here now works
fn get_length(name: Option<String>) -> Option<u8> {
name.map(|n| n.len())
}
}
nativeModule.get_length() // Works as of v0.1.1
nativeModule.get_length("1") // Always worked
nativeModule.get_length(null) // Always worked
nativeModule.get_length(undefined) // Always worked