Skip to content

Instantly share code, notes, and snippets.

@autioch
Created September 17, 2017 17:49
Show Gist options
  • Save autioch/7c96d2f948e8fee3a3db983a9252d229 to your computer and use it in GitHub Desktop.
Save autioch/7c96d2f948e8fee3a3db983a9252d229 to your computer and use it in GitHub Desktop.
Stringify function
module.exports = function stringifyFunction(obj) {
return JSON.stringify(obj, (key, value) => {
if (typeof value === 'function') {
return `[Function ${value.name}]`;
}
return value;
}, ' ');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment