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

Function getData

code/third-party/public/app.js:2034–2062  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2032}
2033
2034function getData() {
2035 if (compositionState._fallbackText) {
2036 return compositionState._fallbackText;
2037 }
2038
2039 var start = void 0;
2040 var startValue = compositionState._startText;
2041 var startLength = startValue.length;
2042 var end = void 0;
2043 var endValue = getText();
2044 var endLength = endValue.length;
2045
2046 for (start = 0; start < startLength; start++) {
2047 if (startValue[start] !== endValue[start]) {
2048 break;
2049 }
2050 }
2051
2052 var minEnd = startLength - start;
2053 for (end = 1; end <= minEnd; end++) {
2054 if (startValue[startLength - end] !== endValue[endLength - end]) {
2055 break;
2056 }
2057 }
2058
2059 var sliceTail = end > 1 ? 1 - end : undefined;
2060 compositionState._fallbackText = endValue.slice(start, sliceTail);
2061 return compositionState._fallbackText;
2062}
2063
2064function getText() {
2065 if ('value' in compositionState._root) {

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected