File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,6 @@ function stringifyPosition(
9999 info ?: unknown ,
100100 options ?: Options | null
101101) : string {
102- /**
103- * Serialized positional info.
104- *
105- * @var {string} serialized
106- */
107- let serialized : string = ''
108-
109102 if ( typeof info === 'object' && info ) {
110103 /**
111104 * Info passed around.
@@ -115,23 +108,23 @@ function stringifyPosition(
115108 const state : State = { offsets : options ?. offsets ?? false }
116109
117110 // range
118- if ( Array . isArray ( info ) ) serialized = range ( < Range > info , state )
111+ if ( Array . isArray ( info ) ) return range ( < Range > info , state )
119112
120113 // node
121114 if ( 'position' in info || 'type' in info ) {
122- serialized = position ( ( < NodeLike > info ) . position , state )
115+ return position ( ( < NodeLike > info ) . position , state )
123116 }
124117
125118 // position
126119 if ( 'end' in info || 'start' in info ) {
127- serialized = position ( < PositionLike > info , state )
120+ return position ( < PositionLike > info , state )
128121 }
129122
130123 // point
131- if ( 'column' in info || 'line' in info ) serialized = point ( < PointLike > info )
124+ if ( 'column' in info || 'line' in info ) return point ( < PointLike > info )
132125 }
133126
134- return serialized
127+ return ''
135128}
136129
137130export default stringifyPosition
You can’t perform that action at this time.
0 commit comments