Skip to content

Commit

Permalink
Merge pull request #98 from bavix/comment
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
rez1dent3 authored Feb 26, 2024
2 parents c24c75d + deb0752 commit 5aa1864
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions public/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Notify } from 'notiflix/build/notiflix-notify-aio';
const SIGNED = 2 ** 0
const UNSIGNED = 2 ** 1

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

export function intTypeList() {
Expand Down Expand Up @@ -109,13 +109,13 @@ export default class InputComponent extends React.Component {
}

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

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

return {input: results[0].toString(), comment: ""}
return {input: results[0].toString(), comment: undefined}
}

normalize = (input) => {
Expand Down
2 changes: 0 additions & 2 deletions src/object-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ const hlrg = /^(-?\d+)[;:,](-?\d+)$/
const trg = /["']?(-?\d+)["']?/g

export function objectParse(val) {
val = val.replace(/[]/g, '') // adhoc

if (val[0] === '[') {
return JSON.parse(val.replace(trg, '$1'))
}
Expand Down

0 comments on commit 5aa1864

Please sign in to comment.