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

Function getData

code/styling/public/app.js:2801–2829  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

extractCompositionEventFunction · 0.70

Calls 1

getTextFunction · 0.70

Tested by

no test coverage detected