MCPcopy Create free account
hub / github.com/unconed/TermKit / eachLine

Function eachLine

HTML/external/syntaxhighlighter_3.0.83/src/shCore.js:702–710  ·  view source on GitHub ↗

* Executes a callback on each line and replaces each line with result from the callback. * @param {Object} str Input string. * @param {Object} callback Callback function taking one string argument and returning a string.

(str, callback)

Source from the content-addressed store, hash-verified

700 * @param {Object} callback Callback function taking one string argument and returning a string.
701 */
702function eachLine(str, callback)
703{
704 var lines = splitLines(str);
705
706 for (var i = 0; i < lines.length; i++)
707 lines[i] = callback(lines[i], i);
708
709 return lines.join('\n');
710};
711
712/**
713 * This is a special trim which only removes first and last empty lines

Callers 3

wrapLinesWithCodeFunction · 0.85
processSmartTabsFunction · 0.85
shCore.jsFile · 0.85

Calls 2

splitLinesFunction · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected