toPlainObject

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.class

This function take a instance as parameter and return a plain object of it

Params

  1. instance*-Mixed

    Any class instance to transform into a plain object

Return

  1. -Object

    A plain object version of the the class instance

Example

import { toPlainObject } from '@blackbyte/sugar/class';
class Coco {
   constructor() {
     this.hello = 'world';
   }
}
toPlainObject(new Coco()); // => { hello: 'world' }

Todo

  • testsnormal

Author