MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / segmentWords

Function segmentWords

src/test/resources/libraries/html2canvas/html2canvas.js:4451–4461  ·  view source on GitHub ↗
(value, styles)

Source from the content-addressed store, hash-verified

4449 return splitGraphemes(value);
4450 };
4451 var segmentWords = function (value, styles) {
4452 if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
4453 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4454 var segmenter = new Intl.Segmenter(void 0, {
4455 granularity: 'word'
4456 });
4457 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4458 return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
4459 }
4460 return breakWords(value, styles);
4461 };
4462 var breakText = function (value, styles) {
4463 return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);
4464 };

Callers 1

breakTextFunction · 0.85

Calls 3

breakWordsFunction · 0.85
mapMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…