Commit b23e98c 1 parent 1073f8a commit b23e98c Copy full SHA for b23e98c
File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 17
17
}
18
18
19
19
function converts ( to ) {
20
- return function ( text ) {
20
+ function convert ( text ) {
21
21
return text . replace ( newline , to )
22
22
}
23
+ convert . toString = function ( ) {
24
+ return to
25
+ }
26
+ return convert
23
27
}
24
28
25
29
function split ( text ) {
Original file line number Diff line number Diff line change 28
28
aok ( 'split cr' , eol . split ( '0\r1\r2' ) . join ( '' ) === '012' )
29
29
aok ( 'split crlf' , eol . split ( '0\r\n1\r\n2' ) . join ( '' ) === '012' )
30
30
aok ( 'split mixed' , eol . split ( '0\r\n1\n2\r3\r\n4' ) . join ( '' ) === '01234' )
31
+ aok ( 'lf function coerces to string' , String ( eol . lf ) === '\n' )
32
+ aok ( 'crlf function coerces to string' , String ( eol . crlf ) === '\r\n' )
33
+ aok ( 'cr function coerces to string' , String ( eol . cr ) === '\r' )
34
+ aok ( 'auto function coerces to string' , String ( eol . auto ) === isWindows ? '\r\n' : '\n' )
31
35
32
36
aok . pass ( meths , function ( method , i ) {
33
37
var normalized = eol [ method ] ( sample )
You can’t perform that action at this time.
0 commit comments