Skip to content

Commit 91b4b55

Browse files
authored
Fix validation for removed terms types
#1020
2 parents 60a2343 + 665db13 commit 91b4b55

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5-
## Unreleased
5+
## Unreleased [patch]
6+
7+
### Fixed
8+
9+
- Fix validation for removed terms types
610

711
## 0.30.0 - 2023-07-10
812

scripts/declarations/validate/index.mocha.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export default async options => {
7878
if (!schemaOnly && service) {
7979
service.getTermsTypes()
8080
.filter(termsType => {
81+
if (!service.terms[termsType]?.latest) { // If this terms type has been deleted and there is only a historical record for it, but no current valid declaration
82+
return false;
83+
}
84+
8185
if (servicesTermsTypes[serviceId] && servicesTermsTypes[serviceId].length > 0) {
8286
return servicesTermsTypes[serviceId].includes(termsType);
8387
}

0 commit comments

Comments
 (0)