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

Function stringify

test/angular/1.6/angular.js:2191–2210  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

2189}
2190
2191function stringify(value) {
2192 if (value == null) { // null || undefined
2193 return '';
2194 }
2195 switch (typeof value) {
2196 case 'string':
2197 break;
2198 case 'number':
2199 value = '' + value;
2200 break;
2201 default:
2202 if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {
2203 value = value.toString();
2204 } else {
2205 value = toJson(value);
2206 }
2207 }
2208
2209 return value;
2210}
2211
2212var NODE_TYPE_ELEMENT = 1;
2213var NODE_TYPE_ATTRIBUTE = 2;

Callers 2

angular.jsFile · 0.70

Calls 4

isArrayFunction · 0.85
hasCustomToStringFunction · 0.70
isDateFunction · 0.70
toJsonFunction · 0.70

Tested by

no test coverage detected