* 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)
| 111 | * @function |
| 112 | */ |
| 113 | function splitNewlines(str) { |
| 114 | if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) { |
| 115 | return str.split('\n'); |
| 116 | } |
| 117 | return str; |
| 118 | } |
| 119 | |
| 120 | |
| 121 | /** |
no outgoing calls
no test coverage detected