MCPcopy
hub / github.com/angular-ui/ui-router / toJson

Function toJson

test/angular/1.4/angular.js:1261–1267  ·  view source on GitHub ↗

* @ngdoc function * @name angular.toJson * @module ng * @kind function * * @description * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be * stripped since angular uses this notation internally. * * @param {Object|Array|Date|string|number} obj Inp

(obj, pretty)

Source from the content-addressed store, hash-verified

1259 * @returns {string|undefined} JSON-ified string representing `obj`.
1260 */
1261function toJson(obj, pretty) {
1262 if (isUndefined(obj)) return undefined;
1263 if (!isNumber(pretty)) {
1264 pretty = pretty ? 2 : null;
1265 }
1266 return JSON.stringify(obj, toJsonReplacer, pretty);
1267}
1268
1269
1270/**

Callers 4

serializeValueFunction · 0.70
$HttpProviderFunction · 0.70
stringifyFunction · 0.70
jsonFilterFunction · 0.70

Calls 2

isUndefinedFunction · 0.70
isNumberFunction · 0.70

Tested by

no test coverage detected