Skip to content

Commit 4ed63f8

Browse files
committed
Ensure filters history files are properly handled
1 parent 0790559 commit 4ed63f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/declarations/utils/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class DeclarationUtils {
99
}
1010

1111
static getServiceIdFromFilePath(filePath) {
12-
return path.parse(filePath.replace(/\.history|\.filters/, '')).name;
12+
return path.parse(filePath.replace(/\.history|\.filters/g, '')).name;
1313
}
1414

1515
async getJSONFromFile(ref, filePath) {
@@ -47,7 +47,7 @@ export default class DeclarationUtils {
4747
return; // Assuming history modifications imply corresponding changes in the service declaration and that the analysis of which terms types of this service have changed will be done when analysing the related declaration, no further action is required here
4848
}
4949

50-
if (modifiedFilePath.endsWith('.filters.js')) {
50+
if (modifiedFilePath.endsWith('.filters.js') || modifiedFilePath.endsWith('.filters.history.js')) {
5151
const declaration = await this.getJSONFromFile(this.defaultBranch, `declarations/${serviceId}.json`);
5252

5353
servicesTermsTypes[serviceId] = Object.keys(declaration.terms); // Considering how rarely filters are used, simply return all term types that could potentially be impacted to spare implementing a function change check

0 commit comments

Comments
 (0)