Plato on Github
Report Home
src/serialize.js
Maintainability
127.13
Lines of code
32
Difficulty
13.20
Estimated Errors
0.10
Function weight
By Complexity
By SLOC
define('lyria/serialize', ['jquery'], function($) { /** * * @param {Object} anyObject * * @returns {String} */ var serialize = function(anyObject) { if ((anyObject === undefined) || ( anyObject instanceof $)) { return; } if (typeof anyObject === 'function') { return anyObject.toString(); } return JSON.stringify(anyObject, function(key, value) { if (value instanceof $) { return null; } if (typeof value === 'function') { value = value.toString(); } return value; }); }; return serialize; });