mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
fix(napi): TypedArray napi < 6 compatible issue
This commit is contained in:
parent
364082ca7a
commit
d151318131
@ -40,7 +40,9 @@ pub enum TypedArrayType {
|
||||
Uint32,
|
||||
Float32,
|
||||
Float64,
|
||||
#[cfg(napi6)]
|
||||
BigInt64,
|
||||
#[cfg(napi6)]
|
||||
BigUint64,
|
||||
}
|
||||
|
||||
@ -56,7 +58,9 @@ impl From<sys::napi_typedarray_type> for TypedArrayType {
|
||||
sys::napi_typedarray_type::napi_uint32_array => Self::Uint32,
|
||||
sys::napi_typedarray_type::napi_float32_array => Self::Float32,
|
||||
sys::napi_typedarray_type::napi_float64_array => Self::Float64,
|
||||
#[cfg(napi6)]
|
||||
sys::napi_typedarray_type::napi_bigint64_array => Self::BigInt64,
|
||||
#[cfg(napi6)]
|
||||
sys::napi_typedarray_type::napi_biguint64_array => Self::BigUint64,
|
||||
}
|
||||
}
|
||||
@ -74,7 +78,9 @@ impl From<TypedArrayType> for sys::napi_typedarray_type {
|
||||
TypedArrayType::Uint32 => sys::napi_typedarray_type::napi_uint32_array,
|
||||
TypedArrayType::Float32 => sys::napi_typedarray_type::napi_float32_array,
|
||||
TypedArrayType::Float64 => sys::napi_typedarray_type::napi_float64_array,
|
||||
#[cfg(napi6)]
|
||||
TypedArrayType::BigInt64 => sys::napi_typedarray_type::napi_bigint64_array,
|
||||
#[cfg(napi6)]
|
||||
TypedArrayType::BigUint64 => sys::napi_typedarray_type::napi_biguint64_array,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user