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

Function checkAlignment

test/parallel/test-util-inspect.js:1425–1439  ·  view source on GitHub ↗
(container, start, lineX, end)

Source from the content-addressed store, hash-verified

1423// Assumes that the first numeric character is the start of an item.
1424{
1425 function checkAlignment(container, start, lineX, end) {
1426 const lines = util.inspect(container).split('\n');
1427 lines.forEach((line, i) => {
1428 if (i === 0) {
1429 assert.strictEqual(line, start);
1430 } else if (i === lines.length - 1) {
1431 assert.strictEqual(line, end);
1432 } else {
1433 let expected = lineX.replace('X', i - 1);
1434 if (i !== lines.length - 2)
1435 expected += ',';
1436 assert.strictEqual(line, expected);
1437 }
1438 });
1439 }
1440
1441 const bigArray = [];
1442 for (let i = 0; i < 100; i++) {

Callers 1

Calls 3

inspectMethod · 0.80
forEachMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…