MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / getData

Function getData

code/new-context-api/public/app.js:2162–2190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2160}
2161
2162function getData() {
2163 if (compositionState._fallbackText) {
2164 return compositionState._fallbackText;
2165 }
2166
2167 var start = void 0;
2168 var startValue = compositionState._startText;
2169 var startLength = startValue.length;
2170 var end = void 0;
2171 var endValue = getText();
2172 var endLength = endValue.length;
2173
2174 for (start = 0; start < startLength; start++) {
2175 if (startValue[start] !== endValue[start]) {
2176 break;
2177 }
2178 }
2179
2180 var minEnd = startLength - start;
2181 for (end = 1; end <= minEnd; end++) {
2182 if (startValue[startLength - end] !== endValue[endLength - end]) {
2183 break;
2184 }
2185 }
2186
2187 var sliceTail = end > 1 ? 1 - end : undefined;
2188 compositionState._fallbackText = endValue.slice(start, sliceTail);
2189 return compositionState._fallbackText;
2190}
2191
2192function getText() {
2193 if ('value' in compositionState._root) {

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected