MCPcopy
hub / github.com/ts-essentials/ts-essentials / applyRules

Function applyRules

scripts/update-test-tsconfig.js:17–31  ·  view source on GitHub ↗
(json, tsVersion)

Source from the content-addressed store, hash-verified

15 * @param {string} tsVersion
16 */
17const applyRules = (json, tsVersion) => {
18 const ALL_CONDITIONAL_FILES = Object.keys(CONDITIONAL_FILES);
19
20 // reset `exclude` to the original state, without any conditional files
21
22 let exclude = (json.exclude || []).filter((v) => !ALL_CONDITIONAL_FILES.includes(v));
23
24 Object.entries(CONDITIONAL_FILES).forEach(([file, tsVersionConstraint]) => {
25 if (semver.satisfies(tsVersion, tsVersionConstraint)) {
26 exclude.push(file);
27 }
28 });
29
30 json.exclude = exclude;
31};
32
33/**
34 * @param {string} tsVersion

Callers 1

updateTsConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…