You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
405 B
21 lines
405 B
/* eslint-env node */
|
|
|
|
import { inspect } from "util";
|
|
|
|
/**
|
|
* @example
|
|
* ```
|
|
* Float16Array.prototype[Symbol.for("nodejs.util.inspect.custom")] = customInspect;
|
|
* ```
|
|
*/
|
|
export function customInspect(_deps, options) {
|
|
const length = this.length;
|
|
|
|
const array = [];
|
|
for (let i = 0; i < length; ++i) {
|
|
array[i] = this[i];
|
|
}
|
|
|
|
return `Float16Array(${length}) ${inspect(array, options)}`;
|
|
}
|