MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

benchmark/buffers/buffer-isutf8.js:14–23  ·  view source on GitHub ↗
({ n, input, length })

Source from the content-addressed store, hash-verified

12
13
14function main({ n, input, length }) {
15 const normalizedInput = length === 'short' ? input : input.repeat(300);
16 const encoder = new TextEncoder();
17 const buff = encoder.encode(normalizedInput);
18 bench.start();
19 for (let i = 0; i < n; ++i) {
20 assert.ok(buffer.isUtf8(buff));
21 }
22 bench.end(n);
23}

Callers

nothing calls this directly

Calls 5

encodeMethod · 0.95
isUtf8Method · 0.80
startMethod · 0.45
okMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…