From 147072056355c0c9aae44d2aa186f86f426161f8 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Sat, 25 Jan 2025 11:53:12 +0000 Subject: [PATCH 1/3] feat: adds napi/create-bool --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/napi/create-bool/README.md | 229 ++++++++++++++++++ .../@stdlib/napi/create-bool/binding.gyp | 170 +++++++++++++ .../napi/create-bool/docs/types/index.d.ts | 33 +++ .../napi/create-bool/docs/types/test.ts | 28 +++ .../napi/create-bool/examples/index.js | 24 ++ .../@stdlib/napi/create-bool/include.gypi | 53 ++++ .../include/stdlib/napi/create_bool.h | 78 ++++++ .../@stdlib/napi/create-bool/lib/browser.js | 28 +++ .../@stdlib/napi/create-bool/lib/index.js | 39 +++ .../@stdlib/napi/create-bool/lib/main.js | 33 +++ .../@stdlib/napi/create-bool/lib/native.js | 46 ++++ .../@stdlib/napi/create-bool/manifest.json | 42 ++++ .../@stdlib/napi/create-bool/package.json | 64 +++++ .../@stdlib/napi/create-bool/src/Makefile | 70 ++++++ .../@stdlib/napi/create-bool/src/addon.c | 65 +++++ .../@stdlib/napi/create-bool/src/main.c | 53 ++++ .../napi/create-bool/test/test.browser.js | 33 +++ .../@stdlib/napi/create-bool/test/test.js | 48 ++++ .../napi/create-bool/test/test.native.js | 88 +++++++ 19 files changed, 1224 insertions(+) create mode 100644 lib/node_modules/@stdlib/napi/create-bool/README.md create mode 100644 lib/node_modules/@stdlib/napi/create-bool/binding.gyp create mode 100644 lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/napi/create-bool/examples/index.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/include.gypi create mode 100644 lib/node_modules/@stdlib/napi/create-bool/include/stdlib/napi/create_bool.h create mode 100644 lib/node_modules/@stdlib/napi/create-bool/lib/browser.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/lib/index.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/lib/main.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/lib/native.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/manifest.json create mode 100644 lib/node_modules/@stdlib/napi/create-bool/package.json create mode 100644 lib/node_modules/@stdlib/napi/create-bool/src/Makefile create mode 100644 lib/node_modules/@stdlib/napi/create-bool/src/addon.c create mode 100644 lib/node_modules/@stdlib/napi/create-bool/src/main.c create mode 100644 lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/test/test.js create mode 100644 lib/node_modules/@stdlib/napi/create-bool/test/test.native.js diff --git a/lib/node_modules/@stdlib/napi/create-bool/README.md b/lib/node_modules/@stdlib/napi/create-bool/README.md new file mode 100644 index 000000000000..18236db967ed --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/README.md @@ -0,0 +1,229 @@ + + +# create_bool + +> Convert a boolean value to a Node-API value. + + + +
+ +
+ + + + + +
+ +## Usage + +```javascript +var headerDir = require( '@stdlib/napi/create-bool' ); +``` + +#### headerDir + +Absolute file path for the directory containing header files for C APIs. + +```javascript +var dir = headerDir; +// returns +``` + +
+ + + + + +
+ +
+ + + + + +
+ +## Examples + +```javascript +var headerDir = require( '@stdlib/napi/create-bool' ); + +console.log( headerDir ); +// => +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/napi/create_bool.h" +``` + +#### stdlib_napi_create_bool( env, value, \*out ) + +Converts a boolean value to a Node-API value. + +```c +#include "stdlib/napi/create_bool.h" +#include +#include + +static napi_value addon( napi_env env, napi_callback_info info ) { + + // ... + + napi_value value; + napi_status status = stdlib_napi_create_bool( env, true, &value ); + assert( status == napi_ok ); + if ( err != NULL ) { + assert( napi_throw( env, err ) == napi_ok ); + return NULL; + } + + // ... +} +``` + +The function accepts the following arguments: + +- **env**: `[in] napi_env` environment under which the function is invoked. +- **value**: `[in] bool` boolean value. +- **out**: `[out] napi_value*` destination for storing output value. + +```c +napi_status stdlib_napi_create_bool( const napi_env env, const bool value, napi_value *out ); +``` + +The function returns a `napi_status` status code indicating success or failure (returns `napi_ok` if success). + +#### STDLIB_NAPI_CREATE_BOOL( env, expression, name ) + +Macro for converting a boolean value to a Node-API value. + +```c +#include "stdlib/napi/create_bool.h" +#include "stdlib/napi/argv_bool.h" +#include "stdlib/napi/argv.h" +#include +#include + +static bool fcn( const bool v ) { + return v; +} + +// ... + +static napi_value addon( napi_env env, napi_callback_info info ) { + // Retrieve add-on callback arguments: + STDLIB_NAPI_ARGV( env, info, argv, argc, 1 ); + + // Convert the first argument to a C type: + STDLIB_NAPI_ARGV_BOOL( env, value, argv, 0 ); + + // ... + + // Convert a value having a C type to a Node-API value: + STDLIB_NAPI_CREATE_BOOL( env, fcn( value ), out ); + + return out; +} +``` + +The macro expects the following arguments: + +- **env**: environment under which the callback is invoked. +- **expression**: expression returning a boolean value. +- **name**: output variable name. + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/napi/create-bool/binding.gyp b/lib/node_modules/@stdlib/napi/create-bool/binding.gyp new file mode 100644 index 000000000000..ec3992233442 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/binding.gyp @@ -0,0 +1,170 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts b/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts new file mode 100644 index 000000000000..fc952d4d5614 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts @@ -0,0 +1,33 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Absolute file path for the directory containing header files for C APIs. +* +* @example +* var dir = headerDir; +* // returns +*/ +declare const headerDir: string; + + +// EXPORTS // + +export = headerDir; diff --git a/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts b/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts new file mode 100644 index 000000000000..24aa79341233 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts @@ -0,0 +1,28 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import headerDir = require( './index' ); + + +// TESTS // + +// The variable is a string... +{ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + headerDir; // $ExpectType string +} diff --git a/lib/node_modules/@stdlib/napi/create-bool/examples/index.js b/lib/node_modules/@stdlib/napi/create-bool/examples/index.js new file mode 100644 index 000000000000..bb9dc2decca5 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/examples/index.js @@ -0,0 +1,24 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +var headerDir = require( './../lib' ); + +console.log( headerDir ); +// => diff --git a/lib/node_modules/@stdlib/napi/create-bool/include.gypi b/lib/node_modules/@stdlib/napi/create-bool/include.gypi new file mode 100644 index 000000000000..575cb043c0bf --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/include.gypi @@ -0,0 +1,53 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A GYP include file for building a Node.js native add-on. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + ' +#include + +/** +* Macro for converting a boolean value to a Node-API value. +* +* @param env environment under which the function is invoked +* @param expression expression returning a boolean value +* @param name output variable name +* +* @example +# #include "stdlib/napi/create_bool.h" +* #include "stdlib/napi/argv_bool.h" +* #include "stdlib/napi/argv.h" +* #include +* +* static bool fcn( const bool v ) { +* return v; +* } +* +* // ... +* +* static napi_value addon( napi_env env, napi_callback_info info ) { +* // Retrieve add-on callback arguments: +* STDLIB_NAPI_ARGV( env, info, argv, argc, 1 ); +* +* // Convert the first argument to a C type: +* STDLIB_NAPI_ARGV_BOOL( env, value, argv, 0 ); +* +* // ... +* +* // Convert a value having a C type to a Node-API value: +* STDLIB_NAPI_CREATE_BOOL( env, fcn( value ), out ); +* return out; +* } +*/ +#define STDLIB_NAPI_CREATE_BOOL( env, expression, name ) \ + napi_value name; \ + stdlib_napi_create_bool( env, expression, &name ); + +/* +* If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. +*/ +#ifdef __cplusplus +extern "C" { +#endif + +/** +* Converts a boolean value to a Node-API value. +*/ +napi_status stdlib_napi_create_bool( const napi_env env, const bool value, napi_value *out ); + +#ifdef __cplusplus +} +#endif + +#endif // !STDLIB_NAPI_CREATE_BOOL_H diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js b/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js new file mode 100644 index 000000000000..42a55a142b79 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js @@ -0,0 +1,28 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +var dir = null; + + +// EXPORTS // + +module.exports = dir; diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/index.js b/lib/node_modules/@stdlib/napi/create-bool/lib/index.js new file mode 100644 index 000000000000..4a392d8e6768 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/index.js @@ -0,0 +1,39 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* Absolute file path for the directory containing header files for C APIs. +* +* @module @stdlib/napi/create-bool +* +* @example +* var headerDir = require( '@stdlib/napi/create-bool' ); +* +* console.log( headerDir ); +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/main.js b/lib/node_modules/@stdlib/napi/create-bool/lib/main.js new file mode 100644 index 000000000000..3650c95099cc --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/main.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; + + +// MAIN // + +var dir = resolve( __dirname, '..', 'include' ); + + +// EXPORTS // + +module.exports = dir; diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/native.js b/lib/node_modules/@stdlib/napi/create-bool/lib/native.js new file mode 100644 index 000000000000..0dbb069c2c99 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/native.js @@ -0,0 +1,46 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Wrapper function exposing the C API to JavaScript. +* +* @private +* @param {number} v - input value +* @returns {number} input value +* +* @example +* var v = wrapper( true ); +* // returns true +*/ +function wrapper( v ) { + return addon( v ); +} + + +// EXPORTS // + +module.exports = wrapper; diff --git a/lib/node_modules/@stdlib/napi/create-bool/manifest.json b/lib/node_modules/@stdlib/napi/create-bool/manifest.json new file mode 100644 index 000000000000..533b753a4109 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/manifest.json @@ -0,0 +1,42 @@ +{ + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [ + "./src/main.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/assert/napi/status-ok", + "@stdlib/napi/argv-bool", + "@stdlib/napi/argv" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/napi/create-bool/package.json b/lib/node_modules/@stdlib/napi/create-bool/package.json new file mode 100644 index 000000000000..8aa66e222185 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/package.json @@ -0,0 +1,64 @@ +{ + "name": "@stdlib/napi", + "version": "0.0.0", + "description": "C APIs for creating Node-API native add-ons.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "browser": "./lib/browser.js", + "directories": { + "doc": "./docs", + "example": "./examples", + "include": "./include", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "napi", + "n-api", + "node-api", + "addon" + ], + "__stdlib__": { + "envs": { + "browser": false + } + } +} diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/Makefile b/lib/node_modules/@stdlib/napi/create-bool/src/Makefile new file mode 100644 index 000000000000..bcf18aa46655 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/addon.c b/lib/node_modules/@stdlib/napi/create-bool/src/addon.c new file mode 100644 index 000000000000..333c575bf700 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/src/addon.c @@ -0,0 +1,65 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/napi/create_bool.h" +#include "stdlib/napi/argv_bool.h" +#include "stdlib/napi/argv.h" +#include +#include +#include + +/** +* Identity function. +* +* @param v input value +* @return input value +*/ +static bool identity( const bool v ) { + return v; +} + +/** +* Receives JavaScript callback invocation data. +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 1 ) + STDLIB_NAPI_ARGV_BOOL( env, value, argv, 0 ) + bool out = identity( value ); + STDLIB_NAPI_CREATE_BOOL( env, out, v ) + return v; +} + +/** +* Initializes a Node-API module. +* +* @param env environment under which the function is invoked +* @param exports exports object +* @return main export +*/ +static napi_value init( napi_env env, napi_value exports ) { + napi_value fcn; + napi_status status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, addon, NULL, &fcn ); + assert( status == napi_ok ); + return fcn; +} + +NAPI_MODULE( NODE_GYP_MODULE_NAME, init ) diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/main.c b/lib/node_modules/@stdlib/napi/create-bool/src/main.c new file mode 100644 index 000000000000..60044777295c --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/src/main.c @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#include "stdlib/napi/create_bool.h" +#include "stdlib/assert/napi/status_ok.h" +#include + +/** +* Converts a boolean value to a Node-API value. +* +* @param env environment under which the function is invoked +* @param value boolean value +* @param out destination for storing output value +* @return status code indicating success or failure (returns `napi_ok` if success) +* +* @example +* #include "stdlib/napi/create_bool.h" +* #include +* +* static napi_value addon( napi_env env, napi_callback_info info ) { +* +* // ... +* +* napi_value value; +* napi_status status = stdlib_napi_create_bool( env, true, &value ); +* assert( status == napi_ok ); +* if ( err != NULL ) { +* assert( napi_throw( env, err ) == napi_ok ); +* return NULL; +* } +* +* // ... +* } +*/ +napi_status stdlib_napi_create_bool( const napi_env env, const bool value, napi_value *out ) { + STDLIB_ASSERT_NAPI_STATUS_OK_RET_VALUE( env, napi_get_boolean( env, value, out ), "", napi_ok ) + return napi_ok; +} diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js new file mode 100644 index 000000000000..f87947821658 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js @@ -0,0 +1,33 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var headerDir = require( './../lib/browser.js' ); + + +// TESTS // + +tape( 'main export is null', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( headerDir, null, 'main export is null' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.js new file mode 100644 index 000000000000..c5371e67dcd8 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var headerDir = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a string', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof headerDir, 'string', 'main export is a string' ); + t.end(); +}); + +tape( 'the exported value corresponds to the package directory containing header files', opts, function test( t ) { + var dir = resolve( __dirname, '..', 'include' ); + t.strictEqual( headerDir, dir, 'exports expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js new file mode 100644 index 000000000000..dcc3fb9ddbe6 --- /dev/null +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js @@ -0,0 +1,88 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var tryRequire = require( '@stdlib/utils/try-require' ); + + +// VARIABLES // + +var addon = tryRequire( resolve( __dirname, './../lib/native.js' ) ); +var opts = { + 'skip': ( addon instanceof Error ) +}; + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof addon, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function throws an error if provided an argument which is not a number', opts, function test( t ) { + var values; + var i; + + values = [ + '5', + null, + void 0, + [], + {}, + NaN, + 0, + 1.0 + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), Error, 'throws an error when provided '+values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + addon( value ); + }; + } +}); + +tape( 'the function does not throw an error if provided a boolean', opts, function test( t ) { + var values; + var v; + var i; + + values = [ + true, + false + ]; + for ( i = 0; i < values.length; i++ ) { + v = addon( values[ i ] ); + if ( values[ i ] === values[ i ] ) { + t.strictEqual( v, values[ i ], 'returns expected value when provided '+values[ i ] ); + } else { + t.strictEqual( v !== v, true, 'returns expected value when provided '+values[ i ] ); + } + } + t.end(); +}); From 1cc3433beb10b3d1cd84f98fe56d78a8962e5b05 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Sat, 25 Jan 2025 12:01:39 +0000 Subject: [PATCH 2/3] chore: fixed main.c --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- lib/node_modules/@stdlib/napi/create-bool/src/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/main.c b/lib/node_modules/@stdlib/napi/create-bool/src/main.c index 60044777295c..3b543e3e93f4 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/src/main.c +++ b/lib/node_modules/@stdlib/napi/create-bool/src/main.c @@ -19,6 +19,7 @@ #include "stdlib/napi/create_bool.h" #include "stdlib/assert/napi/status_ok.h" #include +#include /** * Converts a boolean value to a Node-API value. From 9de88b1320f96a85946dea951013a3333828955d Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Sat, 25 Jan 2025 19:01:20 +0000 Subject: [PATCH 3/3] chore: updated copyright years --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- lib/node_modules/@stdlib/napi/create-bool/README.md | 2 +- lib/node_modules/@stdlib/napi/create-bool/binding.gyp | 2 +- .../@stdlib/napi/create-bool/docs/types/index.d.ts | 2 +- .../@stdlib/napi/create-bool/docs/types/test.ts | 2 +- lib/node_modules/@stdlib/napi/create-bool/examples/index.js | 2 +- lib/node_modules/@stdlib/napi/create-bool/include.gypi | 2 +- .../napi/create-bool/include/stdlib/napi/create_bool.h | 6 +++--- lib/node_modules/@stdlib/napi/create-bool/lib/browser.js | 2 +- lib/node_modules/@stdlib/napi/create-bool/lib/index.js | 2 +- lib/node_modules/@stdlib/napi/create-bool/lib/main.js | 2 +- lib/node_modules/@stdlib/napi/create-bool/lib/native.js | 6 +++--- lib/node_modules/@stdlib/napi/create-bool/src/Makefile | 2 +- lib/node_modules/@stdlib/napi/create-bool/src/addon.c | 2 +- lib/node_modules/@stdlib/napi/create-bool/src/main.c | 5 +++-- .../@stdlib/napi/create-bool/test/test.browser.js | 2 +- lib/node_modules/@stdlib/napi/create-bool/test/test.js | 2 +- .../@stdlib/napi/create-bool/test/test.native.js | 2 +- 17 files changed, 23 insertions(+), 22 deletions(-) diff --git a/lib/node_modules/@stdlib/napi/create-bool/README.md b/lib/node_modules/@stdlib/napi/create-bool/README.md index 18236db967ed..7eeaac39f58b 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/README.md +++ b/lib/node_modules/@stdlib/napi/create-bool/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2025 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/binding.gyp b/lib/node_modules/@stdlib/napi/create-bool/binding.gyp index ec3992233442..68a1ca11d160 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/binding.gyp +++ b/lib/node_modules/@stdlib/napi/create-bool/binding.gyp @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 The Stdlib Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts b/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts index fc952d4d5614..fd6d90004849 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/napi/create-bool/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts b/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts index 24aa79341233..d7e59543e51e 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts +++ b/lib/node_modules/@stdlib/napi/create-bool/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/examples/index.js b/lib/node_modules/@stdlib/napi/create-bool/examples/index.js index bb9dc2decca5..b0b1fa522f05 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/examples/index.js +++ b/lib/node_modules/@stdlib/napi/create-bool/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/include.gypi b/lib/node_modules/@stdlib/napi/create-bool/include.gypi index 575cb043c0bf..ecfaf82a3279 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/include.gypi +++ b/lib/node_modules/@stdlib/napi/create-bool/include.gypi @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 The Stdlib Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/include/stdlib/napi/create_bool.h b/lib/node_modules/@stdlib/napi/create-bool/include/stdlib/napi/create_bool.h index 9669f17660d8..3c491629774a 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/include/stdlib/napi/create_bool.h +++ b/lib/node_modules/@stdlib/napi/create-bool/include/stdlib/napi/create_bool.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ #include /** -* Macro for converting a boolean value to a Node-API value. +* Macro for converting a boolean to a Node-API value. * * @param env environment under which the function is invoked * @param expression expression returning a boolean value @@ -67,7 +67,7 @@ extern "C" { #endif /** -* Converts a boolean value to a Node-API value. +* Converts a boolean to a Node-API value. */ napi_status stdlib_napi_create_bool( const napi_env env, const bool value, napi_value *out ); diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js b/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js index 42a55a142b79..104fe93e3a6c 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/browser.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/index.js b/lib/node_modules/@stdlib/napi/create-bool/lib/index.js index 4a392d8e6768..57fd1e971c4a 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/lib/index.js +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/main.js b/lib/node_modules/@stdlib/napi/create-bool/lib/main.js index 3650c95099cc..d09f5d231f4d 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/lib/main.js +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/main.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/lib/native.js b/lib/node_modules/@stdlib/napi/create-bool/lib/native.js index 0dbb069c2c99..bade3e048960 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/lib/native.js +++ b/lib/node_modules/@stdlib/napi/create-bool/lib/native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ var addon = require( './../src/addon.node' ); * Wrapper function exposing the C API to JavaScript. * * @private -* @param {number} v - input value -* @returns {number} input value +* @param {boolean} v - input value +* @returns {boolean} input value * * @example * var v = wrapper( true ); diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/Makefile b/lib/node_modules/@stdlib/napi/create-bool/src/Makefile index bcf18aa46655..7733b6180cb4 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/src/Makefile +++ b/lib/node_modules/@stdlib/napi/create-bool/src/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2025 The Stdlib Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/addon.c b/lib/node_modules/@stdlib/napi/create-bool/src/addon.c index 333c575bf700..9d2a8d30f84d 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/src/addon.c +++ b/lib/node_modules/@stdlib/napi/create-bool/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/src/main.c b/lib/node_modules/@stdlib/napi/create-bool/src/main.c index 3b543e3e93f4..c1eb37aadb30 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/src/main.c +++ b/lib/node_modules/@stdlib/napi/create-bool/src/main.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ #include /** -* Converts a boolean value to a Node-API value. +* Converts a boolean to a Node-API value. * * @param env environment under which the function is invoked * @param value boolean value @@ -32,6 +32,7 @@ * @example * #include "stdlib/napi/create_bool.h" * #include +* #include * * static napi_value addon( napi_env env, napi_callback_info info ) { * diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js index f87947821658..ed4a1e26b956 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.browser.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.js index c5371e67dcd8..3efe6d8d766c 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/test/test.js +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js b/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js index dcc3fb9ddbe6..b4cf0fbfcc9f 100644 --- a/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js +++ b/lib/node_modules/@stdlib/napi/create-bool/test/test.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.