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

Function shallowCopy

lib/test/angular/1.5.0/angular.js:998–1016  ·  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

996 * Assumes that there are no proto properties for objects.
997 */
998function shallowCopy(src, dst) {
999 if (isArray(src)) {
1000 dst = dst || [];
1001
1002 for (var i = 0, ii = src.length; i < ii; i++) {
1003 dst[i] = src[i];
1004 }
1005 } else if (isObject(src)) {
1006 dst = dst || {};
1007
1008 for (var key in src) {
1009 if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
1010 dst[key] = src[key];
1011 }
1012 }
1013 }
1014
1015 return dst || src;
1016}
1017
1018
1019/**

Callers 9

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

Calls 2

isObjectFunction · 0.70
isArrayFunction · 0.50

Tested by

no test coverage detected