Canop / JSON.prune

A pruning version of JSON.stringify, allowing for example to stringify window or any big or recursive object
MIT License
163 stars 27 forks source link

support getters/setters #13

Open cyan-2048 opened 11 months ago

cyan-2048 commented 11 months ago
class MyClass {
    get value() {
        return "wow"
    }
};

const myClass = new MyClass();

console.log(JSON.prune(myClass)); // empty object {}
Canop commented 11 months ago

Would that really be better ? I'd take opinions on that.

cyan-2048 commented 11 months ago

Would that really be better ? I'd take opinions on that.

Probably would be a great option... as a workaround, I'm just using toJSON on my objects