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

Function shallowCopy

test/angular/1.3/angular.js:858–876  ·  view source on GitHub ↗

* Creates a shallow copy of an object, an array or a primitive. * * Assumes that there are no proto properties for objects.

(src, dst)

Source from the content-addressed store, hash-verified

856 * Assumes that there are no proto properties for objects.
857 */
858function shallowCopy(src, dst) {
859 if (isArray(src)) {
860 dst = dst || [];
861
862 for (var i = 0, ii = src.length; i < ii; i++) {
863 dst[i] = src[i];
864 }
865 } else if (isObject(src)) {
866 dst = dst || {};
867
868 for (var key in src) {
869 if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
870 dst[key] = src[key];
871 }
872 }
873 }
874
875 return dst || src;
876}
877
878
879/**

Callers 8

eventHandlerFunction · 0.70
angular.jsFile · 0.70
$HttpProviderFunction · 0.70
sendReqFunction · 0.70
resolvePromiseWithResultFunction · 0.70
$SceProviderFunction · 0.70
ngClassWatchActionFunction · 0.70
setupAsMultipleFunction · 0.70

Calls 2

isArrayFunction · 0.85
isObjectFunction · 0.70

Tested by

no test coverage detected