MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / ElementSize

Method ElementSize

napi-inl.h:2549–2571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2547}
2548
2549inline uint8_t TypedArray::ElementSize() const {
2550 switch (_type) {
2551 case napi_int8_array:
2552 case napi_uint8_array:
2553 case napi_uint8_clamped_array:
2554 return 1;
2555 case napi_int16_array:
2556 case napi_uint16_array:
2557 return 2;
2558 case napi_int32_array:
2559 case napi_uint32_array:
2560 case napi_float32_array:
2561 return 4;
2562 case napi_float64_array:
2563#if (NAPI_VERSION > 5)
2564 case napi_bigint64_array:
2565 case napi_biguint64_array:
2566#endif // (NAPI_VERSION > 5)
2567 return 8;
2568 default:
2569 return 0;
2570 }
2571}
2572
2573inline size_t TypedArray::ElementLength() const {
2574 return _length;

Callers 1

GetTypedArraySizeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected