Closed as not planned
Closed as not planned
Description
Description
The instanceToClass function doesn't exist. It should be changed to the plainToInstance function.
Minimal code-snippet showcasing the problem
Wrong deprecated suggestion, instanceToClass
doesn't exists.
/**
* Deserializes given JSON string to a object of the given class.
*
* @deprecated This function is being removed. Please use the following instead:
* ```
* instanceToClass(cls, JSON.parse(json), options)
* ```
*/
export declare function deserialize<T>(cls: ClassConstructor<T>, json: string, options?: ClassTransformOptions): T;
/**
* Deserializes given JSON string to an array of objects of the given class.
*
* @deprecated This function is being removed. Please use the following instead:
* ```
* JSON.parse(json).map(value => instanceToClass(cls, value, options))
* ```
*
*/
export declare function deserializeArray<T>(cls: ClassConstructor<T>, json: string, options?: ClassTransformOptions): T[];
Expected behavior
It suggest to use instanceToClass
instead of plainToInstance
.
/**
* Deserializes given JSON string to a object of the given class.
*
* @deprecated This function is being removed. Please use the following instead:
* ```
* plainToInstance(cls, JSON.parse(json), options)
* ```
*/
export declare function deserialize<T>(cls: ClassConstructor<T>, json: string, options?: ClassTransformOptions): T;
/**
* Deserializes given JSON string to an array of objects of the given class.
*
* @deprecated This function is being removed. Please use the following instead:
* ```
* JSON.parse(json).map(value => plainToInstance(cls, value, options))
* ```
*
*/
export declare function deserializeArray<T>(cls: ClassConstructor<T>, json: string, options?: ClassTransformOptions): T[];
Actual behavior
It suggest to use instanceToClass
that doesn't exists.