/toSource

naive implementation of Object.toSource

Primary LanguageJavaScript

toSource

Naive implementation of Object.toSource.

Attention! Cyclical references are not checked!

Supports node/CommonJS, AMD and global this object (browser)

Example CommonJS

// require
var toSource = require('./toSource');
// (optional) add it to the Object prototype
Object.prototype.toSource = function(){ return toSource(this); };
var obj = {a:1,b:false};
obj.toSource();
// -> "{a:1,b:false}"

Build Status Coverage Status