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

Function getData

code/event-handlers/public/app.js:2131–2159  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2129}
2130
2131function getData() {
2132 if (compositionState._fallbackText) {
2133 return compositionState._fallbackText;
2134 }
2135
2136 var start = void 0;
2137 var startValue = compositionState._startText;
2138 var startLength = startValue.length;
2139 var end = void 0;
2140 var endValue = getText();
2141 var endLength = endValue.length;
2142
2143 for (start = 0; start < startLength; start++) {
2144 if (startValue[start] !== endValue[start]) {
2145 break;
2146 }
2147 }
2148
2149 var minEnd = startLength - start;
2150 for (end = 1; end <= minEnd; end++) {
2151 if (startValue[startLength - end] !== endValue[endLength - end]) {
2152 break;
2153 }
2154 }
2155
2156 var sliceTail = end > 1 ? 1 - end : undefined;
2157 compositionState._fallbackText = endValue.slice(start, sliceTail);
2158 return compositionState._fallbackText;
2159}
2160
2161function getText() {
2162 if ('value' in compositionState._root) {

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected