MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / includesOf

Function includesOf

__tests__/php-web-root-includes.test.ts:149–150  ·  view source on GitHub ↗
(count: number)

Source from the content-addressed store, hash-verified

147 Object.fromEntries(Array.from({ length: count }, (_, i) => [`${dir ? `${dir}/` : ''}lib/f${i + 1}.php`, fn(`f${i + 1}`)]));
148/** A page's includes of `/lib/f1.php` … `/lib/f<count>.php` from the web root. */
149const includesOf = (count: number): string =>
150 Array.from({ length: count }, (_, i) => `require_once $_SERVER['DOCUMENT_ROOT'] . '/lib/f${i + 1}.php';`).join('\n');
151const page = (count: number, ...more: string[]) => ['<?php', includesOf(count), ...more, ''].join('\n');
152
153describe("the web root the project's includes show, with no webRoot (#3298)", () => {

Callers 1

pageFunction · 0.70

Calls 2

fromMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected