
package.inspect.node.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of float16 Show documentation
Show all versions of float16 Show documentation
IEEE 754 half-precision floating-point for JavaScript
The newest version!
/* eslint-env node */
/**
* Custom inspect function for Node.js
*
* ```
* Float16Array.prototype[Symbol.for("nodejs.util.inspect.custom")] = customInspect;
* ```
* @param {number} _deps
* @param {import("node:util").InspectOptions} options
* @param {import("node:util").inspect} inspect
* @returns {string}
*/
export function customInspect(_deps, options, inspect) {
const length = this.length;
const array = [];
for (let i = 0; i < length; ++i) {
array[i] = this[i];
}
return `Float16Array(${length}) ${inspect(array, options)}`;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy