MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / serializeObject

Function serializeObject

lib/test/angular/1.7.0/angular.js:2618–2639  ·  view source on GitHub ↗
(obj, maxDepth)

Source from the content-addressed store, hash-verified

2616/* exported toDebugString */
2617
2618function serializeObject(obj, maxDepth) {
2619 var seen = [];
2620
2621 // There is no direct way to stringify object until reaching a specific depth
2622 // and a very deep object can cause a performance issue, so we copy the object
2623 // based on this specific depth and then stringify it.
2624 if (isValidObjectMaxDepth(maxDepth)) {
2625 // This file is also included in `angular-loader`, so `copy()` might not always be available in
2626 // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.
2627 obj = angular.copy(obj, null, maxDepth);
2628 }
2629 return JSON.stringify(obj, function(key, val) {
2630 val = toJsonReplacer(key, val);
2631 if (isObject(val)) {
2632
2633 if (seen.indexOf(val) >= 0) return '...';
2634
2635 seen.push(val);
2636 }
2637 return val;
2638 });
2639}
2640
2641function toDebugString(obj, maxDepth) {
2642 if (typeof obj === 'function') {

Callers 1

toDebugStringFunction · 0.70

Calls 3

isValidObjectMaxDepthFunction · 0.70
toJsonReplacerFunction · 0.70
isObjectFunction · 0.70

Tested by

no test coverage detected