blob: 362b65d20a1aba9fc78a1d5f627c91ca8b465395 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
module.exports =
# Public: Determines if a string should be considered linewise or character
#
# text - The string to consider
#
# Returns 'linewise' if the string ends with a line return and 'character'
# otherwise.
copyType: (text) ->
if text.lastIndexOf("\n") is text.length - 1
'linewise'
else if text.lastIndexOf("\r") is text.length - 1
'linewise'
else
'character'
|