MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / getData

Function getData

code/communication/public/app.js:2836–2864  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2834}
2835
2836function getData() {
2837 if (compositionState._fallbackText) {
2838 return compositionState._fallbackText;
2839 }
2840
2841 var start = void 0;
2842 var startValue = compositionState._startText;
2843 var startLength = startValue.length;
2844 var end = void 0;
2845 var endValue = getText();
2846 var endLength = endValue.length;
2847
2848 for (start = 0; start < startLength; start++) {
2849 if (startValue[start] !== endValue[start]) {
2850 break;
2851 }
2852 }
2853
2854 var minEnd = startLength - start;
2855 for (end = 1; end <= minEnd; end++) {
2856 if (startValue[startLength - end] !== endValue[endLength - end]) {
2857 break;
2858 }
2859 }
2860
2861 var sliceTail = end > 1 ? 1 - end : undefined;
2862 compositionState._fallbackText = endValue.slice(start, sliceTail);
2863 return compositionState._fallbackText;
2864}
2865
2866function getText() {
2867 if ('value' in compositionState._root) {

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected