File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { Notify } from 'notiflix/build/notiflix-notify-aio';
10
10
const SIGNED = 2 ** 0
11
11
const UNSIGNED = 2 ** 1
12
12
13
- const rg = / ^ [ " ' ] | [ " ' ] + $ / g
13
+ const rg = / [ " ' “ ” ] / g
14
14
const nrg = / " ( - ? \d + ) " / g
15
15
16
16
export function intTypeList ( ) {
@@ -109,13 +109,13 @@ export default class InputComponent extends React.Component {
109
109
}
110
110
111
111
parse = ( line ) => {
112
- let results = line . split ( "//" ) . map ( s => s . trim ( ) )
112
+ let results = line . split ( "//" ) . map ( s => s . trim ( ) . replace ( / , $ / g , '' ) . trimRight ( ) )
113
113
114
114
if ( results . length > 1 ) {
115
115
return { input : results [ 0 ] . toString ( ) , comment : results [ 1 ] . toString ( ) }
116
116
}
117
117
118
- return { input : results [ 0 ] . toString ( ) , comment : "" }
118
+ return { input : results [ 0 ] . toString ( ) , comment : undefined }
119
119
}
120
120
121
121
normalize = ( input ) => {
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ const hlrg = /^(-?\d+)[;:,](-?\d+)$/
5
5
const trg = / [ " ' ] ? ( - ? \d + ) [ " ' ] ? / g
6
6
7
7
export function objectParse ( val ) {
8
- val = val . replace ( / [ “ ” ] / g, '' ) // adhoc
9
-
10
8
if ( val [ 0 ] === '[' ) {
11
9
return JSON . parse ( val . replace ( trg , '$1' ) )
12
10
}
You can’t perform that action at this time.
0 commit comments