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

Function LineBreaker

src/test/resources/libraries/html2canvas/html2canvas.js:817–840  ·  view source on GitHub ↗
(str, options)

Source from the content-addressed store, hash-verified

815 return Break;
816 }());
817 var LineBreaker = function (str, options) {
818 var codePoints = toCodePoints$1(str);
819 var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2];
820 var length = codePoints.length;
821 var lastEnd = 0;
822 var nextIndex = 0;
823 return {
824 next: function () {
825 if (nextIndex >= length) {
826 return { done: true, value: null };
827 }
828 var lineBreak = BREAK_NOT_ALLOWED$1;
829 while (nextIndex < length &&
830 (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===
831 BREAK_NOT_ALLOWED$1) { }
832 if (lineBreak !== BREAK_NOT_ALLOWED$1 || nextIndex === length) {
833 var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);
834 lastEnd = nextIndex;
835 return { value: value, done: false };
836 }
837 return { done: true, value: null };
838 },
839 };
840 };
841
842 // https://www.w3.org/TR/css-syntax-3
843 var FLAG_UNRESTRICTED = 1 << 0;

Callers 1

breakWordsFunction · 0.85

Calls 3

toCodePoints$1Function · 0.85
cssFormattedClassesFunction · 0.85
_lineBreakAtIndexFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…