MCPcopy Create free account
hub / github.com/PalisadoesFoundation/talawa-api / validateBooleanFields

Function validateBooleanFields

scripts/setup/setup.ts:226–247  ·  view source on GitHub ↗
(answers: SetupAnswers)

Source from the content-addressed store, hash-verified

224 }
225}
226export function validateBooleanFields(answers: SetupAnswers): void {
227 const booleanFields: SetupKey[] = [
228 "CI",
229 "API_IS_APPLY_DRIZZLE_MIGRATIONS",
230 "API_IS_GRAPHIQL",
231 "API_IS_PINO_PRETTY",
232 "API_MINIO_USE_SSL",
233 "API_POSTGRES_SSL_MODE",
234 ];
235 const invalidFields: string[] = [];
236 for (const field of booleanFields) {
237 const value = answers[field];
238 if (value !== undefined && !isBooleanString(value)) {
239 invalidFields.push(field);
240 }
241 }
242 if (invalidFields.length > 0) {
243 throw new Error(
244 `Boolean fields must be "true" or "false": ${invalidFields.join(", ")}`,
245 );
246 }
247}
248export function validatePortNumbers(answers: SetupAnswers): void {
249 const portFields: SetupKey[] = [
250 "API_PORT",

Callers 2

setup.test.tsFile · 0.85
validateAllAnswersFunction · 0.85

Calls 1

isBooleanStringFunction · 0.85

Tested by

no test coverage detected