shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
toJson
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.object
Convert class instances to plain JSON object
Params
- object*-Any
The object to convert
Return
- -Any
The converted object
Example
import { toJson } from '@blackbyte/sugar/object';
class MyClass {
hello = 'world';
something() {}
}
toJson(new MyClass()); // => { hello: 'world' }Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space