middleware.ts ×2

Frontier kind: Code frontier

unlabeled · c_ba2e3ddfdeee

28 tests · 1978 LOC · 18 files · introduces 0 tests · 23 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges23 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
356 ranges1978 lines · 18 files · Browse complete extent
All tests (intent)
28 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 23 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

lib/yargs-factory.ts 14 introduced LOC · 2 ranges

Open complete file

388 throw new YError('coerce callback must be provided');
389 }
391 > // Handled multiple above, down to one key.
392 > const coerceKey = keys;
393 > // This noop tells yargs-parser about the existence of the option
394 > // represented by "coerceKey", so that it can apply camel case expansion
395 > // if needed:
396 > this.#options.key[coerceKey] = true;
397 > this.#globalMiddleware.addCoerceMiddleware(
398 > (
399 argv: Arguments,
400 yargs: YargsInstance
427 }
428 );
429 > }, yargs-factory.ts
430 > coerceKey
431 > );
432 > return this;
433 > }
434 conflicts(
435 key1: string | Dictionary<string | string[]>,
lib/middleware.ts 9 introduced LOC · 2 ranges

Open complete file

46 // per option:
47 addCoerceMiddleware(
48 > callback: MiddlewareCallback, middleware.ts
49 > option: string
50 > ): YargsInstance {
51 > const aliases = this.yargs.getAliases();
52 > this.globalMiddleware = this.globalMiddleware.filter(m => {
53 const toCheck = [...(aliases[option] || []), option];
54 if (!m.option) return true;
55 else return !toCheck.includes(m.option);
56 > }); middleware.ts
57 > (callback as Middleware).option = option;
58 > return this.addMiddleware(callback, true, true, true);
59 > }
60 getMiddleware() {
61 return this.globalMiddleware;