Skip to content

Commit

Permalink
Merge pull request #203 from hed-standard/rewrite-split-hed-string
Browse files Browse the repository at this point in the history
Rewrite HED string parsing and splitting as classes
  • Loading branch information
happy5214 authored Oct 11, 2024
2 parents a166bf6 + cae39a3 commit 70a3681
Show file tree
Hide file tree
Showing 17 changed files with 439 additions and 326 deletions.
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

0 comments on commit 70a3681

Please sign in to comment.