Class-transformer: fix: transforming string to lowercase turns string object into [object object] on latest version 0.3.2

Created on 18 Jan 2021  路  9Comments  路  Source: typestack/class-transformer

Description

Minimal code-snippet showcasing the problem


Expected behavior

Actual behavior

invalid fix

Most helpful comment

572,670 Downloads a week but this package is claiming since in version 0 it still can have a party and do whatever it wants. The MINOR version should have at least been changed.

All 9 comments

I'm seeing the same, @abbasogaji.

@Transform((value) => value.toString())

Guys this is because breaking changes in patch version.
You can fix it like this:

// instead of this
@Transform((value) => value.toString())

// use object destruction as decorator pass object instead of list of arguments
@Transform(({value}) => value.toString())

@uamanager i thought breaking changes should roll out a major release, because this could affect a lot of projects

@abbasogaji Contributors of this library thinking in another way) That's how they broke my production also))

@uamanager ...this is really bad.. I have quite lot of projects (microservices) in production using class-transformer , this is going to be a mess, now I have to make sure new deployments doesn't pick this version to avoid this issue

@abbasogaji just fix version to 0.3.1 for now. that's the quickest way. and then update version and refactor code of microservices one by one.

572,670 Downloads a week but this package is claiming since in version 0 it still can have a party and do whatever it wants. The MINOR version should have at least been changed.

Working as intended, the signature has changed in 0.3.2. It has been deprecated and republished with some extra changes as 0.4.0.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings