From 188f34f74fd8b7394b61af6e850dcf345d0b4782 Mon Sep 17 00:00:00 2001 From: Nicolas Dupont Date: Wed, 6 Sep 2023 14:32:04 +0200 Subject: [PATCH 1/2] Fix validation for removed terms types --- CHANGELOG.md | 6 +++++- scripts/declarations/validate/index.mocha.js | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d49b1efa3..e16e885dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ 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). -## Unreleased +## Unreleased [patch] + +### Fixed + +- Fix validation for removed terms types ## 0.30.0 - 2023-07-10 diff --git a/scripts/declarations/validate/index.mocha.js b/scripts/declarations/validate/index.mocha.js index 02322ee6e..3228a954e 100644 --- a/scripts/declarations/validate/index.mocha.js +++ b/scripts/declarations/validate/index.mocha.js @@ -78,6 +78,10 @@ export default async options => { if (!schemaOnly && service) { service.getTermsTypes() .filter(termsType => { + if (!service.terms[termsType]?.latest) { // If this terms type has been deleted and there is only an historical record for it, but no current valid declaration + return false; + } + if (servicesTermsTypes[serviceId] && servicesTermsTypes[serviceId].length > 0) { return servicesTermsTypes[serviceId].includes(termsType); } From 665db13fc38b486e48b698d95d20e278261d8028 Mon Sep 17 00:00:00 2001 From: Matti Schneider Date: Wed, 6 Sep 2023 15:22:13 +0200 Subject: [PATCH 2/2] Fix typo --- scripts/declarations/validate/index.mocha.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/declarations/validate/index.mocha.js b/scripts/declarations/validate/index.mocha.js index 3228a954e..4a764d657 100644 --- a/scripts/declarations/validate/index.mocha.js +++ b/scripts/declarations/validate/index.mocha.js @@ -78,7 +78,7 @@ export default async options => { if (!schemaOnly && service) { service.getTermsTypes() .filter(termsType => { - if (!service.terms[termsType]?.latest) { // If this terms type has been deleted and there is only an historical record for it, but no current valid declaration + 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 return false; }