Repository: typeorm/typeorm
File: src/query-builder/QueryBuilder.ts (TypeScript)

Code before:
            | string
            | ((qb: this) => string)
            | Brackets
            | NotBrackets
            | ObjectLiteral
            | ObjectLiteral[],
    ): WhereClauseCondition {
        if (typeof where === "string") {
            return where
        }

        if (InstanceChecker.isBrackets(where)) {
            const whereQueryBuilder = this.createQueryBuilder()

            whereQueryBuilder.parentQueryBuilder = this

            whereQueryBuilder.expressionMap.mainAlias =
                this.expressionMap.mainAlias
            whereQueryBuilder.expressionMap.aliasNamePrefixingEnabled =
                this.expressionMap.aliasNamePrefixingEnabled
            whereQueryBuilder.expressionMap.parameters =
                this.expressionMap.parameters
            whereQueryBuilder.expressionMap.nativeParameters =
                this.expressionMap.nativeParameters
            whereQueryBuilder.expressionMap.joinAttributes = [
                ...this.expressionMap.joinAttributes,
            ]

            whereQueryBuilder.expressionMap.wheres = []

            where.whereFactory(whereQueryBuilder as any)

            return {
                operator: InstanceChecker.isNotBrackets(where)
                    ? "not"
                    : "brackets",
                condition: whereQueryBuilder.expressionMap.wheres,
            }
        }

        if (typeof where === "function") {
            return where(this)
        }

        const wheres: ObjectLiteral[] = Array.isArray(where) ? where : [where]
        const clauses: WhereClause[] = []

        for (const where of wheres) {
            const conditions: WhereClauseCondition = []

            // Filter the conditions and set up the parameter values

Review comment (suggestion):
I used the spread because `qodo` complained about the initial copy by reference implementation.

Code after:
            | string
            | ((qb: this) => string)
            | Brackets
            | NotBrackets
            | ObjectLiteral
            | ObjectLiteral[],
    ): WhereClauseCondition {
        if (typeof where === "string") {
            return where
        }

        if (InstanceChecker.isBrackets(where)) {
            const whereQueryBuilder = this.createQueryBuilder()

            whereQueryBuilder.parentQueryBuilder = this

            whereQueryBuilder.expressionMap.mainAlias =
                this.expressionMap.mainAlias
            whereQueryBuilder.expressionMap.aliasNamePrefixingEnabled =
                this.expressionMap.aliasNamePrefixingEnabled
            whereQueryBuilder.expressionMap.parameters =
                this.expressionMap.parameters
            whereQueryBuilder.expressionMap.nativeParameters =
                this.expressionMap.nativeParameters
            whereQueryBuilder.expressionMap.joinAttributes =
                this.expressionMap.joinAttributes

            whereQueryBuilder.expressionMap.wheres = []

            where.whereFactory(whereQueryBuilder as any)

            return {
                operator: InstanceChecker.isNotBrackets(where)
                    ? "not"
                    : "brackets",
                condition: whereQueryBuilder.expressionMap.wheres,
            }
        }

        if (typeof where === "function") {
            return where(this)
        }

        const wheres: ObjectLiteral[] = Array.isArray(where) ? where : [where]
        const clauses: WhereClause[] = []

        for (const where of wheres) {
            const conditions: WhereClauseCondition = []

            // Filter the conditions and set up the parameter values
            for (const [aliasPath, parameterValue] of this.getPredicates(