Repository: typeorm/typeorm
File: src/driver/sqlserver/SqlServerDriver.ts (TypeScript)

Code before:
            )
        } else if (
            column.precision !== null &&
            column.precision !== undefined
        ) {
            return new MssqlParameter(
                value,
                normalizedType as any,
                column.precision,
            )
        } else if (column.scale !== null && column.scale !== undefined) {
            return new MssqlParameter(
                value,
                normalizedType as any,
                column.scale,
            )
        }

        return new MssqlParameter(value, normalizedType as any)
    }

    parametrizeValues(column: ColumnMetadata, value: any) {
        if (value instanceof FindOperator) {
            if (Array.isArray(value.value)) {
                for (let parameterValueChild of value.value) {
                    parameterValueChild = this.parametrizeValues(
                        column,
                        parameterValueChild,
                    )
                }
            } else if (value.type !== "raw") {
                value.transformValue({
                    to: (v) => this.parametrizeValue(column, v),
                    from: (v) => v,
                })
            }
        } else {
            value = this.parametrizeValue(column, value)
        }

        return value
    }

    /**
     * Sql server's parameters needs to be wrapped into special object with type information about this value.
     * This method wraps all values of the given object into MssqlParameter based on their column definitions in the given table.
     */
    parametrizeMap(tablePath: string, map: ObjectLiteral): ObjectLiteral {
        // find metadata for the given table
        if (!this.connection.hasMetadata(tablePath))
            // if no metadata found then we can't proceed because we don't have columns and their types

Review comment (suggestion):
When the array element is a primitive (number, string, boolean, null), this won't work - `parameterValueChild` will be a copy of the value, and mutating it won't change what's in the original array.

Code after:
            )
        } else if (
            column.precision !== null &&
            column.precision !== undefined
        ) {
            return new MssqlParameter(
                value,
                normalizedType as any,
                column.precision,
            )
        } else if (column.scale !== null && column.scale !== undefined) {
            return new MssqlParameter(
                value,
                normalizedType as any,
                column.scale,
            )
        }

        return new MssqlParameter(value, normalizedType as any)
    }

    /**
     * Recursively wraps values (including those inside FindOperators) into MssqlParameter instances,
     * ensuring correct type metadata is passed to the SQL Server driver.
     *
     * - If the value is a FindOperator containing an array, all elements are individually parametrized.
     * - If the value is a non-raw FindOperator, a transformation is applied to its internal value.
     * - Otherwise, the value is passed directly to parametrizeValue for wrapping.
     *
     * This ensures SQL Server receives properly typed parameters for queries involving operators like
     * In, MoreThan, Between, etc.
     */
    parametrizeValues(column: ColumnMetadata, value: any) {
        if (value instanceof FindOperator) {
            if (Array.isArray(value.value)) {
                for (let i = 0; i < value.value.length; i++) {
                    value.value[i] = this.parametrizeValues(
                        column,
                        value.value[i],
                    )
                }
            } else if (value.type !== "raw") {
                value.transformValue({
                    to: (v) => this.parametrizeValue(column, v),
                    from: (v) => v,
                })
            }
        } else {
            value = this.parametrizeValue(column, value)
        }