Remove unnecessary type assertions
This commit is contained in:
parent
6a1c0700c3
commit
20aafcd90c
8 changed files with 23 additions and 11 deletions
5
lib/config-utils.js
generated
5
lib/config-utils.js
generated
|
|
@ -490,10 +490,11 @@ async function loadConfig(languagesInput, queriesInput, configFile, dbLocation,
|
|||
}
|
||||
if (shouldAddConfigFileQueries(queriesInput) &&
|
||||
QUERIES_PROPERTY in parsedYAML) {
|
||||
if (!Array.isArray(parsedYAML[QUERIES_PROPERTY])) {
|
||||
const queriesArr = parsedYAML[QUERIES_PROPERTY];
|
||||
if (!Array.isArray(queriesArr)) {
|
||||
throw new Error(getQueriesInvalid(configFile));
|
||||
}
|
||||
for (const query of parsedYAML[QUERIES_PROPERTY]) {
|
||||
for (const query of queriesArr) {
|
||||
if (!(QUERIES_USES_PROPERTY in query) ||
|
||||
typeof query[QUERIES_USES_PROPERTY] !== "string") {
|
||||
throw new Error(getQueryUsesInvalid(configFile));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue