1
0
Fork 0
This repository has been archived on 2022-08-25. You can view files and clone it, but cannot push or open issues or pull requests.
office365-oauth2-authenticator/src/console/output.js

38 lines
678 B
JavaScript

"use strict";
var Class = require('class.extend');
var Output = Class.extend('Output', {
/**
* Convert and print data to json.
*
* @param mixed data
*/
json: function(data, pretty) {
data = JSON.stringify(
data,
function(key, value) {
if (value === undefined) {
return null;
}
return value;
},
pretty ? 2 : null
);
return this.write(data);
},
/**
* Print data.
*
* @param mixed data
*/
write: function(data) {
console.log(data);
}
});
module.exports = Output;