feat(napi): add impl<T: Into<Vec<u8>>> From<T> for Uint8Array (#1317)
Co-authored-by: any <any@user.tax>
This commit is contained in:
parent
ea18170779
commit
0d49b45ea9
1 changed files with 6 additions and 0 deletions
|
@ -395,3 +395,9 @@ impl_typed_array!(Float64Array, f64, TypedArrayType::Float64);
|
|||
impl_typed_array!(BigInt64Array, i64, TypedArrayType::BigInt64);
|
||||
#[cfg(feature = "napi6")]
|
||||
impl_typed_array!(BigUint64Array, u64, TypedArrayType::BigUint64);
|
||||
|
||||
impl<T: Into<Vec<u8>>> From<T> for Uint8Array {
|
||||
fn from(data: T) -> Self {
|
||||
Uint8Array::new(data.into())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue