MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / toJson

Function toJson

web/static/bower_components/angular/angular.js:1229–1235  ·  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

1227 * @returns {string|undefined} JSON-ified string representing `obj`.
1228 */
1229function toJson(obj, pretty) {
1230 if (typeof obj === 'undefined') return undefined;
1231 if (!isNumber(pretty)) {
1232 pretty = pretty ? 2 : null;
1233 }
1234 return JSON.stringify(obj, toJsonReplacer, pretty);
1235}
1236
1237
1238/**

Callers 4

serializeValueFunction · 0.85
$HttpProviderFunction · 0.85
stringifyFunction · 0.85
jsonFilterFunction · 0.85

Calls 1

isNumberFunction · 0.85

Tested by

no test coverage detected