MCPcopy Create free account
hub / github.com/microsoft/SandDance / getData

Function getData

docs/external/js/react-dom.development.js:8409–8438  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8407 fallbackText = null;
8408 }
8409 function getData() {
8410 if (fallbackText) {
8411 return fallbackText;
8412 }
8413
8414 var start;
8415 var startValue = startText;
8416 var startLength = startValue.length;
8417 var end;
8418 var endValue = getText();
8419 var endLength = endValue.length;
8420
8421 for (start = 0; start < startLength; start++) {
8422 if (startValue[start] !== endValue[start]) {
8423 break;
8424 }
8425 }
8426
8427 var minEnd = startLength - start;
8428
8429 for (end = 1; end <= minEnd; end++) {
8430 if (startValue[startLength - end] !== endValue[endLength - end]) {
8431 break;
8432 }
8433 }
8434
8435 var sliceTail = end > 1 ? 1 - end : undefined;
8436 fallbackText = endValue.slice(start, sliceTail);
8437 return fallbackText;
8438 }
8439 function getText() {
8440 if ('value' in root) {
8441 return root.value;

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected