Scripts: add extra check on suggestions in fixSchemas

This commit is contained in:
Pieter Vander Vennet 2025-01-20 14:12:13 +01:00
parent 0a364c912b
commit ed2d3f9020

View file

@ -227,6 +227,13 @@ function extractHintsFrom(
". Remember that you should use {'if': 'value=[actual_value]', 'then': '[some explanation]'}"
)
}
if (!hintElement.if || !hintElement.then) {
throw (
"A suggestion generated an object missing either `if` or `then` " +
path.join(".") +
". Remember that you should use {'if': 'value=[actual_value]', 'then': '[some explanation]'}"
)
}
}
}