File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module.exports = stringify
77function stringify ( value ) {
88 /* Nothing. */
99 if ( ! value || typeof value !== 'object' ) {
10- return null
10+ return ''
1111 }
1212
1313 /* Node. */
@@ -26,7 +26,7 @@ function stringify(value) {
2626 }
2727
2828 /* ? */
29- return null
29+ return ''
3030}
3131
3232function point ( point ) {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ a node’s position.
5656` string? ` — A range ` ls:cs-le:ce ` (when given ` node ` or
5757` position ` ) or a point ` l:c ` (when given ` point ` ), where ` l ` stands
5858for line, ` c ` for column, ` s ` for ` start ` , and ` e ` for
59- end. ` null ` is returned if the given value is neither ` node ` ,
59+ end. Empty string ( ` '' ` ), is returned if the given value is neither ` node ` ,
6060` position ` , nor ` point ` .
6161
6262## Contribute
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ var test = require('tape')
44var stringify = require ( '.' )
55
66test ( 'stringifyPosition' , function ( t ) {
7- t . equal ( stringify ( ) , null , 'should return `null ` with `undefined`' )
8- t . equal ( stringify ( null ) , null , 'should return `null ` with `null`' )
9- t . equal ( stringify ( 'foo' ) , null , 'should return `null ` with `string`' )
10- t . equal ( stringify ( 5 ) , null , 'should return `null ` with `number`' )
11- t . equal ( stringify ( { } ) , null , 'should return `null ` with `{}`' )
7+ t . equal ( stringify ( ) , '' , 'should return empty `string ` with `undefined`' )
8+ t . equal ( stringify ( null ) , '' , 'should return empty `string ` with `null`' )
9+ t . equal ( stringify ( 'foo' ) , '' , 'should return empty `string ` with `string`' )
10+ t . equal ( stringify ( 5 ) , '' , 'should return empty `string ` with `number`' )
11+ t . equal ( stringify ( { } ) , '' , 'should return empty `string ` with `{}`' )
1212
1313 t . equal (
1414 stringify ( { type : 'text' } ) ,
You can’t perform that action at this time.
0 commit comments