MCPcopy Index your code
hub / github.com/angular-ui/ui-router / copyRecurse

Function copyRecurse

test/angular/1.5/angular.js:917–946  ·  view source on GitHub ↗
(source, destination)

Source from the content-addressed store, hash-verified

915 return copyElement(source);
916
917 function copyRecurse(source, destination) {
918 var h = destination.$$hashKey;
919 var key;
920 if (isArray(source)) {
921 for (var i = 0, ii = source.length; i < ii; i++) {
922 destination.push(copyElement(source[i]));
923 }
924 } else if (isBlankObject(source)) {
925 // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
926 for (key in source) {
927 destination[key] = copyElement(source[key]);
928 }
929 } else if (source && typeof source.hasOwnProperty === 'function') {
930 // Slow path, which must rely on hasOwnProperty
931 for (key in source) {
932 if (source.hasOwnProperty(key)) {
933 destination[key] = copyElement(source[key]);
934 }
935 }
936 } else {
937 // Slowest path --- hasOwnProperty can't be called as a method
938 for (key in source) {
939 if (hasOwnProperty.call(source, key)) {
940 destination[key] = copyElement(source[key]);
941 }
942 }
943 }
944 setHashKey(destination, h);
945 return destination;
946 }
947
948 function copyElement(source) {
949 // Simple values

Callers 2

copyFunction · 0.70
copyElementFunction · 0.70

Calls 4

isArrayFunction · 0.85
copyElementFunction · 0.70
isBlankObjectFunction · 0.70
setHashKeyFunction · 0.70

Tested by

no test coverage detected