MCPcopy Create free account
hub / github.com/chartjs/Chart.js / splitNewlines

Function splitNewlines

src/plugins/plugin.tooltip.js:149–154  ·  view source on GitHub ↗

* Returns array of strings split by newline * @param {*} str - The value to split by newline. * @returns {string|string[]} value if newline present - Returned from String split() method * @function

(str)

Source from the content-addressed store, hash-verified

147 * @function
148 */
149function splitNewlines(str) {
150 if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) {
151 return str.split('\n');
152 }
153 return str;
154}
155
156
157/**

Callers 4

getBeforeAfterBodyLinesFunction · 0.85
getTitleMethod · 0.85
getBodyMethod · 0.85
getFooterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected