Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite HED string parsing and splitting as classes #203

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bids/types/json.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isPlainObject from 'lodash/isPlainObject'

import { sidecarValueHasHed } from '../utils'
import { parseHedString } from '../../parser/main'
import { parseHedString } from '../../parser/parser'
import ParsedHedString from '../../parser/parsedHedString'
import { BidsFile } from './basic'
import BidsHedSidecarValidator from '../validator/bidsHedSidecarValidator'
Expand Down
2 changes: 1 addition & 1 deletion bids/validator/bidsHedTsvValidator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BidsHedSidecarValidator from './bidsHedSidecarValidator'
import { BidsHedIssue, BidsIssue } from '../types/issues'
import { BidsTsvEvent, BidsTsvRow } from '../types/tsv'
import { parseHedString } from '../../parser/main'
import { parseHedString } from '../../parser/parser'
import ColumnSplicer from '../../parser/columnSplicer'
import ParsedHedString from '../../parser/parsedHedString'
import { generateIssue } from '../../common/issues/issues'
Expand Down
2 changes: 1 addition & 1 deletion converter/converter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseHedString } from '../parser/main'
import { parseHedString } from '../parser/parser'

/**
* Convert a HED string.
Expand Down
2 changes: 1 addition & 1 deletion esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ await esbuild.build({
entryPoints: [path.join(process.cwd(), 'index.js')],
loader: { '.xml': 'text' },
outdir: path.join(process.cwd(), 'dist', 'commonjs'),
target: 'node12',
target: 'node18',
bundle: true,
sourcemap: true,
platform: 'node',
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"pluralize": "^8.0.0",
"semver": "^7.6.0",
"string_decoder": "^1.3.0",
"unicode-name": "^1.0.2",
"xml2js": "^0.6.2"
},
"devDependencies": {
Expand Down Expand Up @@ -74,7 +75,10 @@
"transform": {
"\\.js$": "esbuild-runner/jest",
"\\.xml$": "<rootDir>/fileTransformer.js"
}
},
"transformIgnorePatterns": [
"node_modules/(?!unicode-name)"
]
},
"browser": {
"fs": false
Expand Down
2 changes: 1 addition & 1 deletion parser/columnSplicer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ParsedHedString from './parsedHedString'
import ParsedHedColumnSplice from './parsedHedColumnSplice'
import ParsedHedGroup from './parsedHedGroup'
import { generateIssue } from '../common/issues/issues'
import { parseHedString } from './main'
import { parseHedString } from './parser'

export class ColumnSplicer {
/**
Expand Down
186 changes: 0 additions & 186 deletions parser/main.js

This file was deleted.

Loading
Loading