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

Code before:
                            ? parameterValue.transformValue(column.transformer)
                            : (parameterValue =
                                  ApplyValueTransformers.transformTo(
                                      column.transformer,
                                      parameterValue,
                                  ))
                    }

                    if (
                        this.connection.driver.options.type === "mssql" &&
                        parameterValue.type !== "raw"
                    ) {
                        const driver = this.connection.driver as SqlServerDriver
                        if (parameterValue instanceof FindOperator) {
                            parameterValue.transformValue({
                                to: (v) => driver.parametrizeValue(column, v),
                                from: (v) => v,
                            })
                        } else {
                            parameterValue = driver.parametrizeValue(
                                column,
                                parameterValue,
                            )
                        }
                    }

                    // if (parameterValue === null) {
                    //     andConditions.push(`${aliasPath} IS NULL`);
                    //
                    // } else if (parameterValue instanceof FindOperator) {
                    //     // let parameters: any[] = [];
                    //     // if (parameterValue.useParameter) {
                    //     //     const realParameterValues: any[] = parameterValue.multipleParameters ? parameterValue.value : [parameterValue.value];
                    //     //     realParameterValues.forEach((realParameterValue, realParameterValueIndex) => {
                    //     //
                    //     //         // don't create parameters for number to prevent max number of variables issues as much as possible
                    //     //         if (typeof realParameterValue === "number") {
                    //     //             parameters.push(realParameterValue);
                    //     //
                    //     //         } else {
                    //     //             this.expressionMap.nativeParameters[parameterName + realParameterValueIndex] = realParameterValue;
                    //     //             parameterIndex++;
                    //     //             parameters.push(this.connection.driver.createParameter(parameterName + realParameterValueIndex, parameterIndex - 1));
                    //     //         }
                    //     //     });
                    //     // }
                    //     andConditions.push(
                    //         this.createWhereConditionExpression(this.getWherePredicateCondition(aliasPath, parameterValue))
                    //         // parameterValue.toSql(this.connection, aliasPath, parameters));
                    //     )
                    //

Review comment (suggestion):
Although this works, the comparison against `parameterValue.type` is premature; `parameterValue` might be anything but the `type` property comparison only applies when it is a `FindOperator` instance. Suggest the raw check be moved to the inner condition.

Also adding a comment to explain what this block does:

```suggestion
                    // MSSQL requires parameters to carry extra type information
                    if (this.connection.driver.options.type === "mssql") {
                        const driver = this.connection.driver as SqlServerDriver
                        if (parameterValue instanceof FindOperator) {
                            if (parameterValue.type !== 'raw') {
                                parameterValue.transformValue({
                                    to: (v) => driver.parametrizeValue(column, v),
                                    from: (v) => v,
                                })
                            }
                        } else {
                            parameterValue = driver.parametrizeValue(
                                column,
                                parameterValue,
                            )
                        }
                    }
```

Code after:
                            ? parameterValue.transformValue(column.transformer)
                            : (parameterValue =
                                  ApplyValueTransformers.transformTo(
                                      column.transformer,
                                      parameterValue,
                                  ))
                    }

                    // MSSQL requires parameters to carry extra type information
                    if (this.connection.driver.options.type === "mssql") {
                        const driver = this.connection.driver as SqlServerDriver
                        if (parameterValue instanceof FindOperator) {
                            if (parameterValue.type !== "raw") {
                                parameterValue.transformValue({
                                    to: (v) =>
                                        driver.parametrizeValue(column, v),
                                    from: (v) => v,
                                })
                            }
                        } else {
                            parameterValue = driver.parametrizeValue(
                                column,
                                parameterValue,
                            )
                        }
                    }

                    // if (parameterValue === null) {
                    //     andConditions.push(`${aliasPath} IS NULL`);
                    //
                    // } else if (parameterValue instanceof FindOperator) {
                    //     // let parameters: any[] = [];
                    //     // if (parameterValue.useParameter) {
                    //     //     const realParameterValues: any[] = parameterValue.multipleParameters ? parameterValue.value : [parameterValue.value];
                    //     //     realParameterValues.forEach((realParameterValue, realParameterValueIndex) => {
                    //     //
                    //     //         // don't create parameters for number to prevent max number of variables issues as much as possible
                    //     //         if (typeof realParameterValue === "number") {
                    //     //             parameters.push(realParameterValue);
                    //     //
                    //     //         } else {
                    //     //             this.expressionMap.nativeParameters[parameterName + realParameterValueIndex] = realParameterValue;
                    //     //             parameterIndex++;
                    //     //             parameters.push(this.connection.driver.createParameter(parameterName + realParameterValueIndex, parameterIndex - 1));
                    //     //         }
                    //     //     });
                    //     // }
                    //     andConditions.push(
                    //         this.createWhereConditionExpression(this.getWherePredicateCondition(aliasPath, parameterValue))
                    //         // parameterValue.toSql(this.connection, aliasPath, parameters));
                    //     )