Skip to content

Commit 2bb3121

Browse files
committed
fix
1 parent c24c75d commit 2bb3121

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/input.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Notify } from 'notiflix/build/notiflix-notify-aio';
1010
const SIGNED = 2 ** 0
1111
const UNSIGNED = 2 ** 1
1212

13-
const rg = /^["']|["']+$/g
13+
const rg = /["']/g
1414
const nrg = /"(-?\d+)"/g
1515

1616
export function intTypeList() {
@@ -109,13 +109,13 @@ export default class InputComponent extends React.Component {
109109
}
110110

111111
parse = (line) => {
112-
let results = line.split("//").map(s => s.trim())
112+
let results = line.split("//").map(s => s.trim().replace(/,$/g, '').trimRight())
113113

114114
if (results.length > 1) {
115115
return {input: results[0].toString(), comment: results[1].toString()}
116116
}
117117

118-
return {input: results[0].toString(), comment: ""}
118+
return {input: results[0].toString(), comment: undefined}
119119
}
120120

121121
normalize = (input) => {

src/object-parser.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ const hlrg = /^(-?\d+)[;:,](-?\d+)$/
55
const trg = /["']?(-?\d+)["']?/g
66

77
export function objectParse(val) {
8-
val = val.replace(/[]/g, '') // adhoc
9-
108
if (val[0] === '[') {
119
return JSON.parse(val.replace(trg, '$1'))
1210
}

0 commit comments

Comments
 (0)