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

Function getUrlData

benchmark/common.js:373–386  ·  view source on GitHub ↗
(withBase)

Source from the content-addressed store, hash-verified

371};
372
373function getUrlData(withBase) {
374 const data = require('../test/fixtures/wpt/url/resources/urltestdata.json');
375 const result = [];
376 for (const item of data) {
377 if (item.failure || !item.input) continue;
378 if (withBase) {
379 // item.base might be null. It should be converted into `undefined`.
380 result.push([item.input, item.base ?? undefined]);
381 } else if (item.base !== null) {
382 result.push(item.base);
383 }
384 }
385 return result;
386}
387
388/**
389 * Generate an array of data for URL benchmarks to use.

Callers 1

bakeUrlDataFunction · 0.85

Calls 2

requireFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…