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

Function stringify

test/angular/1.7/angular.js:2188–2207  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

2186}
2187
2188function stringify(value) {
2189 if (value == null) { // null || undefined
2190 return '';
2191 }
2192 switch (typeof value) {
2193 case 'string':
2194 break;
2195 case 'number':
2196 value = '' + value;
2197 break;
2198 default:
2199 if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {
2200 value = value.toString();
2201 } else {
2202 value = toJson(value);
2203 }
2204 }
2205
2206 return value;
2207}
2208
2209var NODE_TYPE_ELEMENT = 1;
2210var 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