GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — angular.js/src/stringify.js at master · angular/angular.js
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Expand file tree/ Copy pathstringify.jsMore file actions 37 lines (31 loc) · 1.08 KB / Copy pathstringify.jsFile metadata and controls37 lines (31 loc) · 1.08 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 'use strict'; /* exported toDebugString */ function serializeObject(obj, maxDepth) { var seen = []; // There is no direct way to stringify object until reaching a specific depth // and a very deep object can cause a performance issue, so we copy the object // based on this specific depth and then stringify it. if (isValidObjectMaxDepth(maxDepth)) { // This file is also included in `angular-loader`, so `copy()` might not always be available in // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed. obj = angular.copy(obj, null, maxDepth); } return JSON.stringify(obj, function(key, val) { val = toJsonReplacer(key, val); if (isObject(val)) { if (seen.indexOf(val) >= 0) return '...'; seen.push(val); } return val; }); } function toDebugString(obj, maxDepth) { if (typeof obj === 'function') { return obj.toString().replace(/ \{[\s\S]*$/, ''); } else if (isUndefined(obj)) { return 'undefined'; } else if (typeof obj !== 'string') { return serializeObject(obj, maxDepth); } return obj; } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |