File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ module.exports = stringify
7
7
function stringify ( value ) {
8
8
/* Nothing. */
9
9
if ( ! value || typeof value !== 'object' ) {
10
- return null
10
+ return ''
11
11
}
12
12
13
13
/* Node. */
@@ -26,7 +26,7 @@ function stringify(value) {
26
26
}
27
27
28
28
/* ? */
29
- return null
29
+ return ''
30
30
}
31
31
32
32
function point ( point ) {
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ a node’s position.
56
56
` string? ` — A range ` ls:cs-le:ce ` (when given ` node ` or
57
57
` position ` ) or a point ` l:c ` (when given ` point ` ), where ` l ` stands
58
58
for 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 ` ,
60
60
` position ` , nor ` point ` .
61
61
62
62
## Contribute
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ var test = require('tape')
4
4
var stringify = require ( '.' )
5
5
6
6
test ( '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 `{}`' )
12
12
13
13
t . equal (
14
14
stringify ( { type : 'text' } ) ,
You can’t perform that action at this time.
0 commit comments