Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@stdlib/assert-napi-equal-typedarray-types
Advanced tools
Assert that two Node-API typed array data types are equal.
Assert that two Node-API typed array data types are equal.
npm install @stdlib/assert-napi-equal-typedarray-types
var headerDir = require( '@stdlib/assert-napi-equal-typedarray-types' );
Absolute file path for the directory containing header files for C APIs.
var dir = headerDir;
// returns <string>
var headerDir = require( '@stdlib/assert-napi-equal-typedarray-types' );
console.log( headerDir );
// => <string>
#include "stdlib/assert/napi/equal_typedarray_types.h"
Asserts that two Node-API typed array data types are equal.
#include <node_api.h>
static napi_value addon( napi_env env, napi_callback_info info ) {
napi_typedarray_type vtype1;
napi_typedarray_type vtype2;
// ...
napi_value err;
napi_status status = stdlib_assert_napi_equal_typedarray_types( env, vtype1, vtype2, "Must have equal types.", &err );
assert( status == napi_ok );
if ( err != NULL ) {
assert( napi_throw( env, err ) == napi_ok );
return NULL;
}
// ...
}
The function accepts the following arguments:
[in] napi_env
environment under which the function is invoked.[in] napi_valuetype
first data type.[in] napi_valuetype
second data type.[in] char*
error message.[out] napi_value*
pointer for storing a JavaScript error.napi_status stdlib_assert_napi_equal_typedarray_types( const napi_env env, const napi_typedarray_type type1, const napi_typedarray_type type2, const char *message, napi_value *err );
The function returns a napi_status
status code indicating success or failure (returns napi_ok
if success).
err
with a JavaScript error; otherwise, err
is set to NULL
.This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2023. The Stdlib Authors.
0.0.1 (2023-02-02)
No changes reported for this release.
</section> <!-- /.release -->FAQs
Assert that two Node-API typed array data types are equal.
The npm package @stdlib/assert-napi-equal-typedarray-types receives a total of 1,159 weekly downloads. As such, @stdlib/assert-napi-equal-typedarray-types popularity was classified as popular.
We found that @stdlib/assert-napi-equal-typedarray-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.