MCPcopy Create free account
hub / github.com/angular-ui/ui-router / toJson

Function toJson

test/angular/1.3/angular.js:1052–1058  ·  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

1050 * @returns {string|undefined} JSON-ified string representing `obj`.
1051 */
1052function toJson(obj, pretty) {
1053 if (typeof obj === 'undefined') return undefined;
1054 if (!isNumber(pretty)) {
1055 pretty = pretty ? 2 : null;
1056 }
1057 return JSON.stringify(obj, toJsonReplacer, pretty);
1058}
1059
1060
1061/**

Callers 4

$HttpProviderFunction · 0.70
buildUrlFunction · 0.70
stringifyFunction · 0.70
jsonFilterFunction · 0.70

Calls 1

isNumberFunction · 0.70

Tested by

no test coverage detected