-
Notifications
You must be signed in to change notification settings - Fork 520
Closed as not planned
Closed as not planned
Copy link
Labels
status: duplicateIssue is being tracked already in another issue.Issue is being tracked already in another issue.
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.
SlavenIvanov, PerryFinn and JongLim107
Metadata
Metadata
Assignees
Labels
status: duplicateIssue is being tracked already in another issue.Issue is being tracked already in another issue.