MCPcopy
hub / github.com/tdewolff/minify / normalizeTooltipFormatResult

Function normalizeTooltipFormatResult

_benchmarks/sample_echarts.js:20536–20566  ·  view source on GitHub ↗

* For backward compat, normalize the return from `formatTooltip`.

(result // markersExisting: Dictionary<ColorString>
    )

Source from the content-addressed store, hash-verified

20534 */
20535
20536 function normalizeTooltipFormatResult(result // markersExisting: Dictionary<ColorString>
20537 ) {
20538 var markupText; // let markers: Dictionary<ColorString>;
20539
20540 var markupFragment;
20541
20542 if (isObject(result)) {
20543 if (result.type) {
20544 markupFragment = result;
20545 } else {
20546 if ("development" !== 'production') {
20547 console.warn('The return type of `formatTooltip` is not supported: ' + makePrintable(result));
20548 }
20549 } // else {
20550 // markupText = (result as TooltipFormatResultLegacyObject).html;
20551 // markers = (result as TooltipFormatResultLegacyObject).markers;
20552 // if (markersExisting) {
20553 // markers = zrUtil.merge(markersExisting, markers);
20554 // }
20555 // }
20556
20557 } else {
20558 markupText = result;
20559 }
20560
20561 return {
20562 markupText: markupText,
20563 // markers: markers || markersExisting,
20564 markupFragment: markupFragment
20565 };
20566 }
20567
20568 /**
20569 * @param {Object} define

Callers 1

sample_echarts.jsFile · 0.85

Calls 2

makePrintableFunction · 0.85
isObjectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…