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

Function toJson

test/angular/1.6/angular.js:1456–1462  ·  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 AngularJS uses this notation internally. * * @param {Object|Array|Date|string|number|boolea

(obj, pretty)

Source from the content-addressed store, hash-verified

1454 * See https://github.com/angular/angular.js/pull/14221 for more information.
1455 */
1456function toJson(obj, pretty) {
1457 if (isUndefined(obj)) return undefined;
1458 if (!isNumber(pretty)) {
1459 pretty = pretty ? 2 : null;
1460 }
1461 return JSON.stringify(obj, toJsonReplacer, pretty);
1462}
1463
1464
1465/**

Callers 4

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

Calls 2

isUndefinedFunction · 0.70
isNumberFunction · 0.70

Tested by

no test coverage detected