export function parseStringBoolean ( stringBoolean ) { return stringBoolean ? stringBoolean === "true" : undefined ; } export function parseStringArray < TAllowedValue extends string > ( stringArray , optionPropertyName , allowedValues ? ) { if ( ! stringArray ) { return undefined ; } const parsedArray = stringArray . split ( "," ) . map ( it => it . trim ( ) ) ; if ( allowedValues ) { for ( const option of parsedArray ) { if ( ! allowedValues . includes ( option as any ) ) { throw new Error ( `Invalid "${ optionPropertyName }" option value "${ option }" provided for TypeGraphQL generator.` ) ; } } } return parsedArray as TAllowedValue [ ] ; }