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

Function getData

code/higher-order-components/public/app.js:2795–2823  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2793}
2794
2795function getData() {
2796 if (compositionState._fallbackText) {
2797 return compositionState._fallbackText;
2798 }
2799
2800 var start = void 0;
2801 var startValue = compositionState._startText;
2802 var startLength = startValue.length;
2803 var end = void 0;
2804 var endValue = getText();
2805 var endLength = endValue.length;
2806
2807 for (start = 0; start < startLength; start++) {
2808 if (startValue[start] !== endValue[start]) {
2809 break;
2810 }
2811 }
2812
2813 var minEnd = startLength - start;
2814 for (end = 1; end <= minEnd; end++) {
2815 if (startValue[startLength - end] !== endValue[endLength - end]) {
2816 break;
2817 }
2818 }
2819
2820 var sliceTail = end > 1 ? 1 - end : undefined;
2821 compositionState._fallbackText = endValue.slice(start, sliceTail);
2822 return compositionState._fallbackText;
2823}
2824
2825function getText() {
2826 if ('value' in compositionState._root) {

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected