MCPcopy
hub / github.com/tdewolff/minify / copyValue

Function copyValue

_benchmarks/sample_echarts.js:4894–4930  ·  view source on GitHub ↗
(target, source, key)

Source from the content-addressed store, hash-verified

4892 return isArrayLike(value[0]);
4893 }
4894 function copyValue(target, source, key) {
4895 if (isArrayLike(source[key])) {
4896 if (!isArrayLike(target[key])) {
4897 target[key] = [];
4898 }
4899 if (isTypedArray(source[key])) {
4900 var len = source[key].length;
4901 if (target[key].length !== len) {
4902 target[key] = new (source[key].constructor)(len);
4903 copyArrShallow(target[key], source[key], len);
4904 }
4905 }
4906 else {
4907 var sourceArr = source[key];
4908 var targetArr = target[key];
4909 var len0 = sourceArr.length;
4910 if (is2DArray(sourceArr)) {
4911 var len1 = sourceArr[0].length;
4912 for (var i = 0; i < len0; i++) {
4913 if (!targetArr[i]) {
4914 targetArr[i] = Array.prototype.slice.call(sourceArr[i]);
4915 }
4916 else {
4917 copyArrShallow(targetArr[i], sourceArr[i], len1);
4918 }
4919 }
4920 }
4921 else {
4922 copyArrShallow(targetArr, sourceArr, len0);
4923 }
4924 targetArr.length = sourceArr.length;
4925 }
4926 }
4927 else {
4928 target[key] = source[key];
4929 }
4930 }
4931 function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse) {
4932 var animatableKeys = [];
4933 var changedKeys = [];

Callers 1

animateToShallowFunction · 0.85

Calls 4

isTypedArrayFunction · 0.85
copyArrShallowFunction · 0.85
is2DArrayFunction · 0.85
isArrayLikeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…