(json, tsVersion)
| 15 | * @param {string} tsVersion |
| 16 | */ |
| 17 | const 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…