apply-extends.ts ×3

Frontier kind: Code frontier

unlabeled · c_53f08e2bf80c

14 tests · 51 LOC · 3 files · introduces 0 tests · 14 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
3 ranges14 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
16 ranges51 lines · 3 files · Browse complete extent
All tests (intent)
14 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.

Introduced files, introduced tests, and structurally relevant concept specializationapply-extends.ts ×1 · 1 introduced LOCapply-extends.ts ×1yargs.mjs|title=yargs dsl tests config extends handles absolute paths|occurrence=1, yargs.mjs|title=yargs dsl tests config extends does not deep merge objects by default|occurrence=1, +3 · 0 introduced LOCyargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends allows a module to be extended, rather than a JSON file|occurrence=1 · 0 introduced LOCyargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests pkgConf should apply default configurations from extended packages|occurrence=1, yargs.mjs|title=yargs dsl tests pkgConf should apply extended configurations from cwd when no path is given|occurrence=1 · 0 introduced LOCyargs.mjs|title=yargs ds…apply-extends.ts ×1 · 4 introduced LOCapply-extends.ts ×1apply-extends.ts ×1 · 3 introduced LOCapply-extends.ts ×1apply-extends.ts ×1 · 2 introduced LOCapply-extends.ts ×1apply-extends.ts ×2 · 5 introduced LOCapply-extends.ts ×2helpers.mjs|title=applyExtends loads a JSON file if one is referenced by "extends" key|occurrence=1 · 0 introduced LOChelpers.mjs|title=applyE…apply-extends.ts ×2 · 5 introduced LOCapply-extends.ts ×2apply-extends.ts ×3 · 10 introduced LOCapply-extends.ts ×3apply-extends.ts ×2 · 11 introduced LOCapply-extends.ts ×2apply-extends.ts ×4 · 9 introduced LOCapply-extends.ts ×4process-argv.ts ×5 · 13 introduced LOCprocess-argv.ts ×5yerror.ts ×2 · 4 introduced LOCyerror.ts ×2lib/utils/apply-extends.ts · 79 LOCutils/apply-extends.tslib/utils/process-argv.ts · 36 LOCutils/process-argv.tslib/yerror.ts · 9 LOClib/yerror.tshelpers.mjs|title=helpers Parser exposes functional argument parser|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:esm|file=test/esm/helpers.mjs|title=helpers Parser exposes functional argument parser|occurrence=1helpers.mjs|title=helper…helpers.mjs|title=helpers applyExtends exposes applyExtends helper|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:esm|file=test/esm/helpers.mjs|title=helpers applyExtends exposes applyExtends helper|occurrence=1helpers.mjs|title=helper…platform-shim-test.mjs|title=platform-shim y18n __ behaves like sprintf|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:esm|file=test/esm/platform-shim-test.mjs|title=platform-shim y18n __ behaves like sprintf|occurrence=1platform-shim-test.mjs|t…platform-shim-test.mjs|title=platform-shim y18n __n uses first string if singular|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:esm|file=test/esm/platform-shim-test.mjs|title=platform-shim y18n __n uses first string if singular|occurrence=1platform-shim-test.mjs|t…platform-shim-test.mjs|title=platform-shim y18n __n uses second string if plural|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:esm|file=test/esm/platform-shim-test.mjs|title=platform-shim y18n __n uses second string if plural|occurrence=1platform-shim-test.mjs|t…helpers.mjs|title=applyExtends loads a JSON file if one is referenced by "extends" key|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/helpers.mjs|title=applyExtends loads a JSON file if one is referenced by "extends" key|occurrence=1helpers.mjs|title=applyE…parser.mjs|title=should expose yargs-parser as Parser|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/parser.mjs|title=should expose yargs-parser as Parser|occurrence=1parser.mjs|title=should …yargs.mjs|title=yargs dsl tests config extends allows a module to be extended, rather than a JSON file|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends allows a module to be extended, rather than a JSON file|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends allows files with .*rc extension to be extended|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends allows files with .*rc extension to be extended|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends applies default configurations when given config object|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends applies default configurations when given config object|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends deep merges configs when extending when deep-merge-config=true|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends deep merges configs when extending when deep-merge-config=true|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends deep merges multiple configs when extending when deep-merge-config=true|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends deep merges multiple configs when extending when deep-merge-config=true|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends does not deep merge objects by default|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends does not deep merge objects by default|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends handles absolute paths|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends handles absolute paths|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends ignores an extends key that does not look like a path or module|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends ignores an extends key that does not look like a path or module|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends protects against circular extended configurations|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends protects against circular extended configurations|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests config extends tolerates null prototype config objects|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests config extends tolerates null prototype config objects|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests pkgConf should apply default configurations from extended packages|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests pkgConf should apply default configurations from extended packages|occurrence=1yargs.mjs|title=yargs ds…yargs.mjs|title=yargs dsl tests pkgConf should apply extended configurations from cwd when no path is given|occurrence=1 · introduced test · mocha:v1|namespace=yargs@4153e0f097aeaf43a71a2530db6dda51dff2c544:main|file=test/yargs.mjs|title=yargs dsl tests pkgConf should apply extended configurations from cwd when no path is given|occurrence=1yargs.mjs|title=yargs ds…Focused concept · apply-extends.ts ×3 · 14 introduced LOCapply-extends.ts ×3

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.

1 file ranked by introduced lines: 14 introduced LOC across 3 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

lib/utils/apply-extends.ts 14 introduced LOC · 3 ranges

Open complete file

14
15 if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
16 > if (typeof config.extends !== 'string') return defaultConfig; apply-extends.ts
17 > const isPath = /\.json|\..*rc$/.test(config.extends);
18 > let pathToDefault: string | null = null;
19 > if (!isPath) {
20 try {
21 pathToDefault = import.meta.resolve(config.extends);
25 return config;
26 }
27 > } else { apply-extends.ts
28 pathToDefault = getPathToDefaultConfig(cwd, config.extends);
29 }
35 defaultConfig = isPath
36 ? JSON.parse(shim.readFileSync(pathToDefault, 'utf8'))
37 > : _shim.require(config.extends); apply-extends.ts
38 > delete config.extends;
39 > defaultConfig = applyExtends(
40 > defaultConfig,
41 > shim.path.dirname(pathToDefault),
42 > mergeExtends,
43 > shim
44 > );
45 > }
46
47 previouslyVisitedConfigs = [];