diff --git a/.gitignore b/.gitignore index 300d879a..9995fa14 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,37 @@ node_modules .directory .idea dist/ +/venv/ + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +tests/scratch +docs/_build diff --git a/bids/tsvParser.js b/bids/tsvParser.js index 5cde3776..7e1e79b5 100644 --- a/bids/tsvParser.js +++ b/bids/tsvParser.js @@ -12,7 +12,7 @@ const isContentfulRow = (row) => row && !/^\s*$/.test(row) * Parse a TSV file. * * @param {string} contents The contents of a TSV file. - * @return {{headers: string[], rows: string[][]}} The parsed contents of the TSV file. + * @returns {{headers: string[], rows: string[][]}} The parsed contents of the TSV file. */ function parseTSV(contents) { const content = { diff --git a/bids/types.js b/bids/types.js index 53634e62..0498d8c1 100644 --- a/bids/types.js +++ b/bids/types.js @@ -355,7 +355,7 @@ export class BidsIssue { /** * Whether this issue is an error. - * @return {boolean} + * @returns {boolean} */ isError() { return bidsHedErrorCodes.has(this.code) diff --git a/bids/utils.js b/bids/utils.js index c69887f9..cf5341b8 100644 --- a/bids/utils.js +++ b/bids/utils.js @@ -2,7 +2,7 @@ * Determine whether a sidecar value has HED data. * * @param {object} sidecarValue A BIDS sidecar value. - * @return {boolean} Whether the sidecar value has HED data. + * @returns {boolean} Whether the sidecar value has HED data. */ export const sidecarValueHasHed = function (sidecarValue) { return sidecarValue !== null && typeof sidecarValue === 'object' && sidecarValue.HED !== undefined diff --git a/bids/validate.js b/bids/validate.js index f74f6f53..94d72b97 100644 --- a/bids/validate.js +++ b/bids/validate.js @@ -10,7 +10,7 @@ import ParsedHedString from '../validator/parser/parsedHedString' * * @param {BidsDataset} dataset The BIDS dataset. * @param {object} schemaDefinition The version spec for the schema to be loaded. - * @return {Promise} Any issues found. + * @returns {Promise} Any issues found. */ export function validateBidsDataset(dataset, schemaDefinition) { return buildBidsSchemas(dataset, schemaDefinition).then( @@ -30,7 +30,7 @@ export function validateBidsDataset(dataset, schemaDefinition) { * * @param {BidsDataset} dataset A BIDS dataset. * @param {Schemas} hedSchemas A HED schema collection. - * @return {Promise|Promise} Any issues found. + * @returns {Promise|Promise} Any issues found. */ function validateFullDataset(dataset, hedSchemas) { try { @@ -53,7 +53,7 @@ function validateFullDataset(dataset, hedSchemas) { * * @param {BidsTsvFile} tsvFileData A BIDS TSV file. * @param {Schemas} hedSchemas A HED schema collection. - * @return {BidsIssue[]} Any issues found. + * @returns {BidsIssue[]} Any issues found. */ function validateBidsTsvFile(tsvFileData, hedSchemas) { const [hedStrings, tsvIssues] = parseTsvHed(tsvFileData) @@ -70,7 +70,7 @@ function validateBidsTsvFile(tsvFileData, hedSchemas) { * * @param {BidsSidecar[]} sidecarData A collection of BIDS sidecars. * @param {Schemas} hedSchemas A HED schema collection. - * @return {[boolean, BidsHedIssue[]]} Whether errors (as opposed to warnings) were founds, and all issues found. + * @returns {[boolean, BidsHedIssue[]]} Whether errors (as opposed to warnings) were founds, and all issues found. */ function validateSidecars(sidecarData, hedSchemas) { const issues = [] @@ -120,7 +120,7 @@ function validateSidecarString(sidecarKey, sidecarString, sidecar, options, hedS * * @param {BidsEventFile[]} eventData A collection of BIDS event TSV files. * @param {Schemas} hedSchemas A HED schema collection. - * @return {[boolean, BidsHedIssue[]]} Whether errors (as opposed to warnings) were founds, and all issues found. + * @returns {[boolean, BidsHedIssue[]]} Whether errors (as opposed to warnings) were founds, and all issues found. */ function validateHedColumn(eventData, hedSchemas) { const issues = eventData.flatMap((eventFileData) => { @@ -137,7 +137,7 @@ function validateHedColumn(eventData, hedSchemas) { * Combine the BIDS sidecar HED data into a BIDS TSV file's HED data. * * @param {BidsTsvFile} tsvFileData A BIDS TSV file. - * @return {[string[], BidsIssue[]]} The combined HED strings for this BIDS TSV file, and all issues found during the combination. + * @returns {[string[], BidsIssue[]]} The combined HED strings for this BIDS TSV file, and all issues found during the combination. */ function parseTsvHed(tsvFileData) { const hedStrings = [] @@ -203,7 +203,7 @@ function parseTsvHed(tsvFileData) { * @param {string[]} hedStrings The HED strings in the data collection. * @param {Schemas} hedSchemas The HED schema collection to validate against. * @param {BidsTsvFile} tsvFileData The BIDS event TSV file being validated. - * @return {BidsHedIssue[]} Any issues found. + * @returns {BidsHedIssue[]} Any issues found. */ function validateCombinedDataset(hedStrings, hedSchemas, tsvFileData) { const [, hedIssues] = validateHedDatasetWithContext(hedStrings, tsvFileData.mergedSidecar.hedStrings, hedSchemas, { @@ -220,7 +220,7 @@ function validateCombinedDataset(hedStrings, hedSchemas, tsvFileData) { * @param {Schemas} hedSchemas The HED schema collection to validate against. * @param {Object} fileObject A BIDS-format file object used to generate {@link BidsHedIssue} objects. * @param {Object} settings Options to pass to {@link validateHedString}. - * @return {BidsHedIssue[]} Any issues found. + * @returns {BidsHedIssue[]} Any issues found. */ function validateStrings(hedStrings, hedSchemas, fileObject, settings) { const issues = [] @@ -245,7 +245,7 @@ function validateStrings(hedStrings, hedSchemas, fileObject, settings) { * @param {IssueError|Issue[]} hedIssues One or more HED-format issues. * @param {Object} file A BIDS-format file object used to generate {@link BidsHedIssue} objects. * @param {Object?} extraParameters Any extra parameters to inject into the {@link Issue} objects. - * @return {BidsHedIssue[]} The passed issue(s) in BIDS-compatible format. + * @returns {BidsHedIssue[]} The passed issue(s) in BIDS-compatible format. */ function convertHedIssuesToBidsIssues(hedIssues, file, extraParameters) { if (hedIssues instanceof IssueError) { diff --git a/common/issues/issues.js b/common/issues/issues.js index fb7c7fda..2f8237a0 100644 --- a/common/issues/issues.js +++ b/common/issues/issues.js @@ -84,7 +84,7 @@ export class Issue { /** * Override of {@link Object.prototype.toString}. * - * @return {string} This issue's message. + * @returns {string} This issue's message. */ toString() { return this.message @@ -115,7 +115,7 @@ export class Issue { * * @param {string} internalCode The internal error code. * @param {Object} parameters The error string parameters. - * @return {Issue} An object representing the issue. + * @returns {Issue} An object representing the issue. */ export const generateIssue = function (internalCode, parameters) { const issueCodeData = issueData[internalCode] ?? issueData.genericError diff --git a/common/schema/loader.js b/common/schema/loader.js index eb00df6f..c34b532e 100644 --- a/common/schema/loader.js +++ b/common/schema/loader.js @@ -14,7 +14,7 @@ import { fallbackFilePath, localSchemaList } from './config' * @param {SchemaSpec} schemaDef The description of which schema to use. * @param {boolean} useFallback Whether to use a bundled fallback schema if the requested schema cannot be loaded. * @param {boolean} reportNoFallbackError Whether to report an error on a failed schema load when no fallback was used. - * @return {Promise|Promise<[object, Issue[]]>} The schema XML data or an error. + * @returns {Promise|Promise<[object, Issue[]]>} The schema XML data or an error. */ export const loadSchema = function (schemaDef = null, useFallback = true, reportNoFallbackError = true) { const schemaPromise = loadPromise(schemaDef) @@ -52,7 +52,7 @@ export const loadSchema = function (schemaDef = null, useFallback = true, report * @todo Rename to {@link loadSchema} in 4.0.0. * * @param {SchemaSpec} schemaDef The description of which schema to use. - * @return {Promise|Promise<[object, Issue[]]>} The schema XML data or an error. + * @returns {Promise|Promise<[object, Issue[]]>} The schema XML data or an error. */ export const loadSchemaFromSpec = function (schemaDef = null) { const schemaPromise = loadPromise(schemaDef) @@ -66,7 +66,7 @@ export const loadSchemaFromSpec = function (schemaDef = null) { * Choose the schema Promise from a schema version or path description. * * @param {SchemaSpec} schemaDef The description of which schema to use. - * @return {Promise} The schema XML data or an error. + * @returns {Promise} The schema XML data or an error. */ const loadPromise = function (schemaDef) { if (schemaDef === null) { @@ -87,7 +87,7 @@ const loadPromise = function (schemaDef) { * Load schema XML data from the HED GitHub repository. * * @param {SchemaSpec} schemaDef The standard schema version to load. - * @return {Promise} The schema XML data. + * @returns {Promise} The schema XML data. */ const loadRemoteSchema = function (schemaDef) { let url @@ -103,7 +103,7 @@ const loadRemoteSchema = function (schemaDef) { * Load schema XML data from a local file. * * @param {string} path The path to the schema XML data. - * @return {Promise} The schema XML data. + * @returns {Promise} The schema XML data. */ const loadLocalSchema = function (path) { return loadSchemaFile(files.readFile(path), 'localSchemaLoadFailed', { path: path }) @@ -113,7 +113,7 @@ const loadLocalSchema = function (path) { * Load schema XML data from a bundled file. * * @param {SchemaSpec} schemaDef The description of which schema to use. - * @return {Promise} The schema XML data. + * @returns {Promise} The schema XML data. */ const loadBundledSchema = function (schemaDef) { return parseSchemaXML(localSchemaList.get(schemaDef.localName)).catch((error) => { @@ -128,7 +128,7 @@ const loadBundledSchema = function (schemaDef) { * @param {Promise} xmlDataPromise The Promise containing the unparsed XML data. * @param {string} issueCode The issue code. * @param {Object} issueArgs The issue arguments passed from the calling function. - * @return {Promise} The parsed schema XML data. + * @returns {Promise} The parsed schema XML data. */ const loadSchemaFile = function (xmlDataPromise, issueCode, issueArgs) { return xmlDataPromise.then(parseSchemaXML).catch((error) => { @@ -141,7 +141,7 @@ const loadSchemaFile = function (xmlDataPromise, issueCode, issueArgs) { * Parse the schema XML data. * * @param {string} data The XML data. - * @return {Promise} The schema XML data. + * @returns {Promise} The schema XML data. */ const parseSchemaXML = function (data) { return xml2js.parseStringPromise(data, { explicitCharkey: true }) diff --git a/common/schema/types.js b/common/schema/types.js index 61ab51ab..62540709 100644 --- a/common/schema/types.js +++ b/common/schema/types.js @@ -54,13 +54,16 @@ export class Schema { * * @param {string} tag The HED tag to check. * @param {string} tagAttribute The attribute to check for. - * @return {boolean} Whether this tag has this attribute. + * @returns {boolean} Whether this tag has this attribute. * @abstract */ // eslint-disable-next-line no-unused-vars tagHasAttribute(tag, tagAttribute) {} } +/** + * Hed2Schema class + */ export class Hed2Schema extends Schema { /** * The description of tag attributes. @@ -84,13 +87,16 @@ export class Hed2Schema extends Schema { * * @param {string} tag The HED tag to check. * @param {string} tagAttribute The attribute to check for. - * @return {boolean} Whether this tag has this attribute. + * @returns {boolean} Whether this tag has this attribute. */ tagHasAttribute(tag, tagAttribute) { return this.attributes.tagHasAttribute(tag, tagAttribute) } } +/** + * Hed3Schema class + */ export class Hed3Schema extends Schema { /** * The collection of schema entries. @@ -121,7 +127,7 @@ export class Hed3Schema extends Schema { * * @param {string} tag The HED tag to check. * @param {string} tagAttribute The attribute to check for. - * @return {boolean} Whether this tag has this attribute. + * @returns {boolean} Whether this tag has this attribute. */ tagHasAttribute(tag, tagAttribute) { return this.entries.tagHasAttribute(tag, tagAttribute) @@ -235,7 +241,7 @@ export class Schemas { /** * Whether this schema collection is for syntactic validation only. - * @return {boolean} + * @returns {boolean} */ get isSyntaxOnly() { return this.generation === 0 @@ -243,7 +249,7 @@ export class Schemas { /** * Whether this schema collection comprises HED 3 schemas. - * @return {boolean} + * @returns {boolean} */ get isHed3() { return this.generation === 3 diff --git a/converter/__tests__/converter.spec.js b/converter/__tests__/converter.spec.js index e3035f19..fda27d6c 100644 --- a/converter/__tests__/converter.spec.js +++ b/converter/__tests__/converter.spec.js @@ -23,7 +23,7 @@ describe('HED string conversion', () => { * @param {Object} expectedResults The expected results. * @param {Object} expectedIssues The expected issues. * @param {function (Schema, string, string, number): [string, Issue[]]} testFunction The test function. - * @return {Promise} + * @returns {Promise} */ const validatorBase = function (testStrings, expectedResults, expectedIssues, testFunction) { return hedSchemaPromise.then(([hedSchemas, issues]) => { @@ -588,7 +588,7 @@ describe('HED string conversion', () => { * @param {Object} expectedResults The expected results. * @param {Object} expectedIssues The expected issues. * @param {function (Schemas, string): [string, Issue[]]} testFunction The test function. - * @return {Promise} + * @returns {Promise} */ const validatorBase = function (testStrings, expectedResults, expectedIssues, testFunction) { return hedSchemaPromise.then(([hedSchemas, issues]) => { diff --git a/converter/converter.js b/converter/converter.js index 109ad945..30d174af 100644 --- a/converter/converter.js +++ b/converter/converter.js @@ -9,7 +9,7 @@ const doubleSlashPattern = /[\s/]*\/+[\s/]*/g * Remove extra slashes and spaces from a HED string. * * @param {string} hedString The HED string to clean. - * @return {string} The cleaned HED string. + * @returns {string} The cleaned HED string. */ export const removeSlashesAndSpaces = function (hedString) { return hedString.replace(doubleSlashPattern, '/') @@ -26,7 +26,7 @@ export const removeSlashesAndSpaces = function (hedString) { * @param {string} hedTag The HED tag to convert. * @param {string} hedString The full HED string (for error messages). * @param {number} offset The offset of this tag within the HED string. - * @return {[string, Issue[]]} The long-form tag and any issues. + * @returns {[string, Issue[]]} The long-form tag and any issues. */ export const convertTagToLong = function (schema, hedTag, hedString, offset) { const mapping = schema.mapping @@ -128,7 +128,7 @@ export const convertTagToLong = function (schema, hedTag, hedString, offset) { * @param {string} hedTag The HED tag to convert. * @param {string} hedString The full HED string (for error messages). * @param {number} offset The offset of this tag within the HED string. - * @return {[string, Issue[]]} The short-form tag and any issues. + * @returns {[string, Issue[]]} The short-form tag and any issues. */ export const convertTagToShort = function (schema, hedTag, hedString, offset) { const mapping = schema.mapping @@ -199,7 +199,7 @@ export const convertTagToShort = function (schema, hedTag, hedString, offset) { * @param {string} partialHedString The partial HED string to convert to long form. * @param {string} fullHedString The full HED string. * @param {number} offset The offset of the partial HED string within the full string. - * @return {[string, Issue[]]} The converted string and any issues. + * @returns {[string, Issue[]]} The converted string and any issues. */ export const convertPartialHedStringToLong = function (schema, partialHedString, fullHedString, offset) { let issues = [] @@ -234,7 +234,7 @@ export const convertPartialHedStringToLong = function (schema, partialHedString, * @param {Schema} schema The schema object containing a short-to-long mapping. * @param {string} hedString The HED tag to convert. * @param {function (Schema, string, string, number): [string, Issue[]]} conversionFn The conversion function for a tag. - * @return {[string, Issue[]]} The converted string and any issues. + * @returns {[string, Issue[]]} The converted string and any issues. */ const convertHedString = function (schema, hedString, conversionFn) { let issues = [] @@ -268,7 +268,7 @@ const convertHedString = function (schema, hedString, conversionFn) { * * @param {Schemas} schemas The schema container object containing short-to-long mappings. * @param {string} hedString The HED tag to convert. - * @return {[string, Issue[]]} The long-form string and any issues. + * @returns {[string, Issue[]]} The long-form string and any issues. * @deprecated */ export const convertHedStringToLong = function (schemas, hedString) { @@ -280,7 +280,7 @@ export const convertHedStringToLong = function (schemas, hedString) { * * @param {Schemas} schemas The schema container object containing short-to-long mappings. * @param {string} hedString The HED tag to convert. - * @return {[string, Issue[]]} The short-form string and any issues. + * @returns {[string, Issue[]]} The short-form string and any issues. * @deprecated */ export const convertHedStringToShort = function (schemas, hedString) { diff --git a/converter/issues.js b/converter/issues.js index 76e60ef4..736cf17d 100644 --- a/converter/issues.js +++ b/converter/issues.js @@ -10,7 +10,7 @@ import { generateIssue } from '../common/issues/issues' * @param {string} hedString The source HED string. * @param {object} parameters The parameters to the format string. * @param {number[]} bounds The bounds of the problem tag. - * @return {Issue} The issue object. + * @returns {Issue} The issue object. */ export default function (code, hedString, parameters = {}, bounds = []) { parameters.tag = hedString.slice(bounds[0], bounds[1]) diff --git a/converter/schema.js b/converter/schema.js index 952e6a89..3a6abad6 100644 --- a/converter/schema.js +++ b/converter/schema.js @@ -9,7 +9,7 @@ import { generateIssue, IssueError } from '../common/issues/issues' * Build a short-long mapping object from schema XML data. * * @param {SchemaEntries} entries The schema XML data. - * @return {Mapping} The mapping object. + * @returns {Mapping} The mapping object. */ export const buildMappingObject = function (entries) { /** @@ -48,7 +48,7 @@ export const buildMappingObject = function (entries) { * Build a schema container object containing a short-long mapping from a base schema version or path description. * * @param {{path: string?, version: string?}} schemaDef The description of which schema to use. - * @return {Promise|Promise} The schema container object or an error. + * @returns {Promise|Promise} The schema container object or an error. * @deprecated */ export const buildSchema = (schemaDef) => validatorBuildSchema(schemaDef) diff --git a/converter/splitHedString.js b/converter/splitHedString.js index 17ad34c2..c499047d 100644 --- a/converter/splitHedString.js +++ b/converter/splitHedString.js @@ -4,10 +4,10 @@ const tagDelimiters = new Set([',', '(', ')', '~']) * Split a HED string into delimiters and tags. * * @param {string} hedString The HED string to split. - * @return {Array[]} A list of string parts. The boolean is true if the part is + * @returns {Array[]} A list of string parts. The boolean is true if the part is * a tag and false if it is a delimiter. The numbers are the bounds of the part. */ -export default function splitHedString(hedString) { +export function splitHedString(hedString) { const resultPositions = [] let currentSpacing = 0 let insideDelimiter = true @@ -62,3 +62,5 @@ export default function splitHedString(hedString) { return resultPositions } + +export default splitHedString diff --git a/docs/Makefile b/docs/Makefile index 92dd33a1..b8808422 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,26 @@ -# Minimal makefile for Sphinx documentation -# +# We avoid $(CURDIR) because it spits out /cygdrive/c/... on Windows Cygwin +# installs and leads to things that don't work. +VIRTUAL_ENV = venv +PYTHON3 ?= python3 + +# Let us find jsdoc and sphinx: +export PATH := node_modules/.bin:$(VIRTUAL_ENV)/bin:$(VIRTUAL_ENV)/Scripts:$(PATH) + +# I'm not entirely sure why this line is needed yet... +.PHONY: js + +# Verify venv exists +.PHONY: venv +venv: $(VIRTUAL_ENV)/pyvenv.cfg + +$(VIRTUAL_ENV)/pyvenv.cfg: + $(PYTHON3) -m venv $(VIRTUAL_ENV) + PATH="$(PATH)" pip3 install -r requirements.txt + +# Not sure if this is needed... +# .npm_installed: ../package.json +# npm install +# touch $@ # You can set these variables from the command line, and also # from the environment for the first two. @@ -18,3 +39,12 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + + + +# Delete just the built docs, not the whole venv, which is expensive to +# reconstitute: +.PHONY: clean +clean: + rm -rf $(BUILDDIR) + rm -rf node_modules .npm_installed \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 5323fd45..2bc837f2 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,6 @@ portalocker>=2.7.0 semantic_version>=2.10.0 -myst-parser>=1.0.0 -Sphinx==5.2.2 +myst-parser>=0.18.1 +Sphinx>=5.2.2 sphinx_rtd_theme>=1.0.0 sphinx-js>=3.2.1 -typescript>=0.0.12 diff --git a/docs/source/bids.rst b/docs/source/bids.rst new file mode 100644 index 00000000..1b5f8076 --- /dev/null +++ b/docs/source/bids.rst @@ -0,0 +1,13 @@ +bids +==== + +Bids functionality + +.. toctree:: + :maxdepth: 8 + + bids.schema.rst + bids.tsvParser.rst + bids.types.rst + bids.utils.rst + bids.validate.rst diff --git a/docs/source/api2.rst b/docs/source/bids.schema.rst similarity index 50% rename from docs/source/api2.rst rename to docs/source/bids.schema.rst index ec25fbcd..cc7a1cbd 100644 --- a/docs/source/api2.rst +++ b/docs/source/bids.schema.rst @@ -1,3 +1,4 @@ -HED API reference (Auto style) +Schema ============================== +Intentionally Blank diff --git a/docs/source/bids.tsvParser.rst b/docs/source/bids.tsvParser.rst new file mode 100644 index 00000000..10e8635e --- /dev/null +++ b/docs/source/bids.tsvParser.rst @@ -0,0 +1,5 @@ +tsvParse +============================== + +.. js:autofunction:: parseTSV + diff --git a/docs/source/bids.types.rst b/docs/source/bids.types.rst new file mode 100644 index 00000000..7936bcbc --- /dev/null +++ b/docs/source/bids.types.rst @@ -0,0 +1,23 @@ +types +============================== + +.. js:autoclass:: BidsData + :members: + +.. js:autoclass:: BidsFile + :members: + +.. js:autoclass:: BidsJsonFile + :members: + +.. js:autoclass:: BidsTsvFile + :members: + +.. js:autoclass:: BidsEventFile + :members: + +.. js:autoclass:: BidsTabularFile + :members: + +.. js:autoclass:: BidsSidecar + :members: diff --git a/docs/source/bids.utils.rst b/docs/source/bids.utils.rst new file mode 100644 index 00000000..659ed160 --- /dev/null +++ b/docs/source/bids.utils.rst @@ -0,0 +1,5 @@ +utils +============================== + +.. js:autofunction:: sidecarValueHasHed + diff --git a/docs/source/bids.validate.rst b/docs/source/bids.validate.rst new file mode 100644 index 00000000..f864dee6 --- /dev/null +++ b/docs/source/bids.validate.rst @@ -0,0 +1,22 @@ +validate +============================== + +.. js:autofunction:: sidecarValueHasHed + +.. js:autofunction:: validateBidsDataset + +.. js:autofunction:: validateFullDataset + +.. js:autofunction:: validateBidsTsvFile + +.. js:autofunction:: validateSidecars + +.. js:autofunction:: validateHedColumn + +.. js:autofunction:: parseTsvHed + +.. js:autofunction:: validateCombinedDataset + +.. js:autofunction:: validateStrings + +.. js:autofunction:: convertHedIssuesToBidsIssues diff --git a/docs/source/common.issues.data.rst b/docs/source/common.issues.data.rst new file mode 100644 index 00000000..66992cc7 --- /dev/null +++ b/docs/source/common.issues.data.rst @@ -0,0 +1,4 @@ +data +====== + +Intentionally blank for now \ No newline at end of file diff --git a/docs/source/common.issues.issues.rst b/docs/source/common.issues.issues.rst new file mode 100644 index 00000000..d9842b32 --- /dev/null +++ b/docs/source/common.issues.issues.rst @@ -0,0 +1,8 @@ +issues +====== + +.. js:autoclass:: Issue + :members: + +.. js:autofunction:: generateIssue + diff --git a/docs/source/common.issues.rst b/docs/source/common.issues.rst new file mode 100644 index 00000000..0d27171d --- /dev/null +++ b/docs/source/common.issues.rst @@ -0,0 +1,8 @@ +issues +====== + +.. toctree:: + :maxdepth: 8 + + common.issues.issues + common.issues.data \ No newline at end of file diff --git a/docs/source/common.rst b/docs/source/common.rst new file mode 100644 index 00000000..5554cf43 --- /dev/null +++ b/docs/source/common.rst @@ -0,0 +1,8 @@ +common +====== + +.. toctree:: + :maxdepth: 8 + + common.schema + common.issues \ No newline at end of file diff --git a/docs/source/common.schema.config.rst b/docs/source/common.schema.config.rst new file mode 100644 index 00000000..0be67493 --- /dev/null +++ b/docs/source/common.schema.config.rst @@ -0,0 +1,4 @@ +config +====== + +Intentionally blank for now \ No newline at end of file diff --git a/docs/source/common.schema.loader.rst b/docs/source/common.schema.loader.rst new file mode 100644 index 00000000..fc13df03 --- /dev/null +++ b/docs/source/common.schema.loader.rst @@ -0,0 +1,18 @@ +loader +====== + +.. js:autofunction:: loadSchema + +.. js:autofunction:: loadSchemaFromSpec + +.. js:autofunction:: loadPromise + +.. js:autofunction:: loadRemoteSchema + +.. js:autofunction:: loadLocalSchema + +.. js:autofunction:: loadBundledSchema + +.. js:autofunction:: loadSchemaFile + +.. js:autofunction:: parseSchemaXML diff --git a/docs/source/common.schema.rst b/docs/source/common.schema.rst new file mode 100644 index 00000000..783e8233 --- /dev/null +++ b/docs/source/common.schema.rst @@ -0,0 +1,9 @@ +schema +====== + +.. toctree:: + :maxdepth: 8 + + common.schema.types + common.schema.loader + common.schema.config \ No newline at end of file diff --git a/docs/source/common.schema.types.rst b/docs/source/common.schema.types.rst new file mode 100644 index 00000000..332a4842 --- /dev/null +++ b/docs/source/common.schema.types.rst @@ -0,0 +1,20 @@ +types +====== + +.. js:autoclass:: Schema + :members: + +.. js:autoclass:: Hed2Schema + :members: + +.. js:autoclass:: Hed3Schema + :members: + +.. js:autoclass:: Schemas + :members: + +.. js:autoclass:: SchemaSpec + :members: + +.. js:autoclass:: SchemasSpec + :members: diff --git a/docs/source/conf.py b/docs/source/conf.py index 9e23c383..632ec4ff 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,7 +25,8 @@ # Add the Node.js dependency install_requires = [ - 'nodejs>=16.13.2' + 'nodejs>=16.13.2', + 'python>=3.7' ] # The full version, including alpha/beta/rc tags @@ -41,31 +42,29 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - "myst_parser", - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.autosectionlabel", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.mathjax", - "sphinx.ext.viewcode", - "sphinx.ext.githubpages", - "sphinx.ext.napoleon", - "sphinx.ext.extlinks", - "sphinx_js" + # 'sphinx.ext.autodoc', + # 'sphinx.ext.viewcode', + # 'sphinx_click.ext', + 'sphinx_js' ] -js_language = 'typescript' -js_source_path = '../../' +root_for_relative_js_paths = "../../" +base_folders = ["../../bids", "../../validator", "../../converter", "../../common", "../../utils"] -primary_domain = 'js' +def find_all_folders(directory): + all_folders = [directory] + + for root, dirs, _ in os.walk(directory): + for d in dirs: + all_folders.append(os.path.join(root, d)) -autosummary_generate = True -autodoc_default_flags = ['members', 'inherited-members'] -add_module_names = False -myst_all_links_external = False -myst_heading_anchors = 2 -myst_enable_extensions = ["deflist"] + return all_folders + +js_source_path = [] +for folder in base_folders: + js_source_path += find_all_folders(folder) +print(js_source_path) +primary_domain = 'js' # Add any paths that contain templates here, relative to this directory. @@ -76,7 +75,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', '_templates', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ['_build', '_templates', 'Thumbs.db', '.DS_Store', 'venv'] # -- Options for HTML output ------------------------------------------------- @@ -98,13 +97,16 @@ 'vcs_pageview_mode': '', 'style_nav_header_background': 'LightSlateGray', # Toc options - 'collapse_navigation': True, + 'collapse_navigation': False, 'sticky_navigation': True, - 'navigation_depth': 4, + 'navigation_depth': 6, 'includehidden': True, 'titles_only': False } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +import sphinx_rtd_theme +html_static_path = [os.path.join(sphinx_rtd_theme.get_html_theme_path(), 'sphinx_rtd_theme', 'static')] + + diff --git a/docs/source/converter.converter.rst b/docs/source/converter.converter.rst new file mode 100644 index 00000000..60f17848 --- /dev/null +++ b/docs/source/converter.converter.rst @@ -0,0 +1,18 @@ +converter +========= + +.. js:autofunction:: removeSlashesAndSpaces + +.. js:autofunction:: convertTagToLong + +.. js:autofunction:: convertTagToShort + +.. js:autofunction:: convertPartialHedStringToLong + +.. This one is not marked for export + .. js:autofunction:: convertHedString + +.. js:autofunction:: convertHedStringToLong + +.. js:autofunction:: convertHedStringToShort + diff --git a/docs/source/converter.issues.rst b/docs/source/converter.issues.rst new file mode 100644 index 00000000..a4ee0e3b --- /dev/null +++ b/docs/source/converter.issues.rst @@ -0,0 +1,4 @@ +issues +====== + +Intentionally blank for now \ No newline at end of file diff --git a/docs/source/converter.rst b/docs/source/converter.rst new file mode 100644 index 00000000..f35eb0c3 --- /dev/null +++ b/docs/source/converter.rst @@ -0,0 +1,11 @@ +converter +========= + +.. toctree:: + :maxdepth: 8 + + converter.types + converter.schema + converter.issues + converter.splitHedString + converter.converter diff --git a/docs/source/converter.schema.rst b/docs/source/converter.schema.rst new file mode 100644 index 00000000..b693b11e --- /dev/null +++ b/docs/source/converter.schema.rst @@ -0,0 +1,7 @@ +schema +========= + +.. js:autofunction:: buildMappingObject + +.. js:autofunction:: schema.buildSchema + diff --git a/docs/source/converter.splitHedString.rst b/docs/source/converter.splitHedString.rst new file mode 100644 index 00000000..5fc0b30e --- /dev/null +++ b/docs/source/converter.splitHedString.rst @@ -0,0 +1,6 @@ +splitHedString +============== + +.. js:autofunction:: splitHedString + + diff --git a/docs/source/converter.types.rst b/docs/source/converter.types.rst new file mode 100644 index 00000000..5af60b33 --- /dev/null +++ b/docs/source/converter.types.rst @@ -0,0 +1,10 @@ +types +========= + +.. js:autoclass:: TagEntry + :members: + +.. js:autoclass:: Mapping + :members: + + diff --git a/docs/source/index.rst b/docs/source/index.rst index 867d91ff..e031bb49 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,36 +1,40 @@ -Hierarchical Event Descriptor (HED) JavaScript Tools -==================================================== - -.. image:: _static/images/croppedWideLogo.png - :width: 220 - :alt: HedLogo - -.. sidebar:: **Links** - - * `PDF docs `_ - - * `Source code `_ - -Note: this is a work in progress. More information is coming. - -.. toctree:: - :maxdepth: 4 - :caption: Contents: - - introduction.md - user_guide.rst - -.. toctree:: - :maxdepth: 3 - :caption: HED JavaScript API: - - api2.rst - - -Indices and tables -==================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - +Hierarchical Event Descriptor (HED) JavaScript Tools +==================================================== + +.. image:: _static/images/croppedWideLogo.png + :width: 220 + :alt: HedLogo + +.. sidebar:: **Links** + + * `PDF docs `_ + + * `Source code `_ + +Note: this is a work in progress. More information is coming. + +.. toctree:: + :maxdepth: 8 + :caption: Contents: + + introduction.md + user_guide.rst + +.. toctree:: + :maxdepth: 8 + :caption: HED JavaScript API: + + bids.rst + common.rst + converter.rst + utils.rst + validator.rst + + +Indices and tables +==================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst deleted file mode 100644 index 71f63261..00000000 --- a/docs/source/introduction.rst +++ /dev/null @@ -1,50 +0,0 @@ -.. _introduction: - -===================================================== -Introduction to HED -===================================================== - -.. contents:: **Contents** - :local: - :depth: 1 - -Why HED? -======== - -.. topic:: Why use HED? - - HED (Hierarchical Event Descriptors) is an infrastructure and - a controlled vocabulary that allows researchers to annotate - their experimental data, especially events, - so that tools can automatically use this information in analysis. - -For more information on using Hierarchical Event Descriptors (HED) -visit `HED examples `_: - - -Installing hed-javascript -========================= -The hed-javascript tools are available on npm and can be installed using -using the following command: - ->>> npm install hed-validator - - -Finding help -============ - -:Documentation: - - See `HED resources `_ for user documentation and tutorials. - - -:Mailing lists and forums: - - * Don't hesitate to ask questions about the python hedtools on `NeuroStars - `_. - -:Issues and problems: - * If you notice a bug in the python hedtools code or encounter other problems using the tools, please `open an issue`_ in the - hed-javascript repository on github. - -.. _open an issue: https://github.com/hed-standard/hed-javascript/issues diff --git a/docs/source/utils.array.rst b/docs/source/utils.array.rst new file mode 100644 index 00000000..97a67206 --- /dev/null +++ b/docs/source/utils.array.rst @@ -0,0 +1,9 @@ +array +========= + +.. js:autofunction:: getElementCount + +.. js:autofunction:: asArray + +.. js:autofunction:: recursiveMap + diff --git a/docs/source/utils.files.rst b/docs/source/utils.files.rst new file mode 100644 index 00000000..bd33db28 --- /dev/null +++ b/docs/source/utils.files.rst @@ -0,0 +1,6 @@ +files +========= +.. js:autofunction:: readFile + +.. js:autofunction:: readHTTPSFile + diff --git a/docs/source/utils.hedData.rst b/docs/source/utils.hedData.rst new file mode 100644 index 00000000..8e1a5a35 --- /dev/null +++ b/docs/source/utils.hedData.rst @@ -0,0 +1,10 @@ +hedData +========= + +.. js:autofunction:: getGenerationForSchemaVersion + +.. No documentation yet + .. js:autofunction:: mergeParsingIssues + +.. js:autofunction:: getParsedParentTags + diff --git a/docs/source/utils.hedStrings.rst b/docs/source/utils.hedStrings.rst new file mode 100644 index 00000000..4fb6face --- /dev/null +++ b/docs/source/utils.hedStrings.rst @@ -0,0 +1,18 @@ +hedStrings +========= +.. js:autofunction:: replaceTagNameWithPound + +.. no documentation yet +# .. js:autofunction:: getTagSlashIndices + +.. js:autofunction:: getTagLevels + +.. js:autofunction:: hedStrings.getTagName + +.. js:autofunction:: hedStrings.getParentTag + +.. js:autofunction:: hedStringIsAGroup + +.. js:autofunction:: loadSchemaFile + +.. js:autofunction:: removeGroupParentheses diff --git a/docs/source/utils.map.rst b/docs/source/utils.map.rst new file mode 100644 index 00000000..0cceb576 --- /dev/null +++ b/docs/source/utils.map.rst @@ -0,0 +1,6 @@ +map +=== + +Intentionally blank for now +# .. js:autofunction:: filterNonEqualDuplicates + diff --git a/docs/source/utils.rst b/docs/source/utils.rst new file mode 100644 index 00000000..902978ef --- /dev/null +++ b/docs/source/utils.rst @@ -0,0 +1,15 @@ +utils +===== + +.. toctree:: + :maxdepth: 8 + + utils.xml2js + utils.map + utils.types + utils.files + utils.xpath + utils.string + utils.hedData + utils.array + utils.hedStrings \ No newline at end of file diff --git a/docs/source/utils.string.rst b/docs/source/utils.string.rst new file mode 100644 index 00000000..818b4492 --- /dev/null +++ b/docs/source/utils.string.rst @@ -0,0 +1,16 @@ +string +====== + +.. js:autofunction:: stringIsEmpty + +.. js:autofunction:: getCharacterCount + +.. js:autofunction:: capitalizeString + +.. js:autofunction:: isClockFaceTime + +.. js:autofunction:: isDateTime + +.. js:autofunction:: isNumber + +.. js:autofunction:: stringTemplate diff --git a/docs/source/utils.types.rst b/docs/source/utils.types.rst new file mode 100644 index 00000000..1e747d2a --- /dev/null +++ b/docs/source/utils.types.rst @@ -0,0 +1,8 @@ +types +========= + +.. js:autoclass:: MemoizerMixin + :members: + +.. js:autoclass:: Memoizer + :members: diff --git a/docs/source/utils.xml2js.rst b/docs/source/utils.xml2js.rst new file mode 100644 index 00000000..f4523835 --- /dev/null +++ b/docs/source/utils.xml2js.rst @@ -0,0 +1,7 @@ +xml2js +========= + +.. not exported + .. js:autofunction:: setNodeParent + +.. js:autofunction:: setParent diff --git a/docs/source/utils.xpath.rst b/docs/source/utils.xpath.rst new file mode 100644 index 00000000..a31f97bf --- /dev/null +++ b/docs/source/utils.xpath.rst @@ -0,0 +1,8 @@ +xpath +========= + +.. js:autofunction:: find + +.. js:autofunction:: parseXPath + +.. js:autofunction:: search diff --git a/docs/source/validator.dataset.rst b/docs/source/validator.dataset.rst new file mode 100644 index 00000000..b48d62bc --- /dev/null +++ b/docs/source/validator.dataset.rst @@ -0,0 +1,16 @@ +dataset +========= + +.. js:autofunction:: parseDefinitions + +.. js:autofunction:: checkGroupForTemporalOrder + +.. js:autofunction:: validateTemporalOrder + +.. js:autofunction:: validateDataset + +.. js:autofunction:: validateHedEvents + +.. js:autofunction:: validateHedDataset + +.. js:autofunction:: validateHedDatasetWithContext diff --git a/docs/source/validator.event.hed3.rst b/docs/source/validator.event.hed3.rst new file mode 100644 index 00000000..36563f9c --- /dev/null +++ b/docs/source/validator.event.hed3.rst @@ -0,0 +1,5 @@ +hed3 +========= + +.. js:autoclass:: Hed3Validator + :members: \ No newline at end of file diff --git a/docs/source/validator.event.init.rst b/docs/source/validator.event.init.rst new file mode 100644 index 00000000..20d1d613 --- /dev/null +++ b/docs/source/validator.event.init.rst @@ -0,0 +1,10 @@ +init +========= + +.. js:autofunction:: initiallyValidateHedString + +.. js:autofunction:: validateHedString + +.. js:autofunction:: validateHedEvent + +.. js:autofunction:: validateHedEventWithDefinitions \ No newline at end of file diff --git a/docs/source/validator.event.rst b/docs/source/validator.event.rst new file mode 100644 index 00000000..a77be92a --- /dev/null +++ b/docs/source/validator.event.rst @@ -0,0 +1,9 @@ +event +===== + +.. toctree:: + :maxdepth: 8 + + validator.event.init + validator.event.validator + validator.event.hed3 \ No newline at end of file diff --git a/docs/source/validator.event.validator.rst b/docs/source/validator.event.validator.rst new file mode 100644 index 00000000..3e0eeaef --- /dev/null +++ b/docs/source/validator.event.validator.rst @@ -0,0 +1,4 @@ +validator +========= +.. js:autoclass:: HedValidator + :members: \ No newline at end of file diff --git a/docs/source/validator.hed2.event.hed2Validator.rst b/docs/source/validator.hed2.event.hed2Validator.rst new file mode 100644 index 00000000..623a93f2 --- /dev/null +++ b/docs/source/validator.hed2.event.hed2Validator.rst @@ -0,0 +1,5 @@ +hed2Validator +============= + +.. js:autoclass:: Hed2Validator + :members: diff --git a/docs/source/validator.hed2.event.rst b/docs/source/validator.hed2.event.rst new file mode 100644 index 00000000..c94f5857 --- /dev/null +++ b/docs/source/validator.hed2.event.rst @@ -0,0 +1,8 @@ +event +===== + +.. toctree:: + :maxdepth: 8 + + validator.hed2.event.hed2Validator + validator.hed2.event.units \ No newline at end of file diff --git a/docs/source/validator.hed2.event.units.rst b/docs/source/validator.hed2.event.units.rst new file mode 100644 index 00000000..a0353dcf --- /dev/null +++ b/docs/source/validator.hed2.event.units.rst @@ -0,0 +1,10 @@ +units +========= + +.. js:autofunction:: units.validateUnits + +.. js:autofunction:: isPrefixUnit + +.. js:autofunction:: getValidDerivativeUnits + +.. js:autofunction:: getAllUnits \ No newline at end of file diff --git a/docs/source/validator.hed2.parser.parsedHed2Tag.rst b/docs/source/validator.hed2.parser.parsedHed2Tag.rst new file mode 100644 index 00000000..ed9c633c --- /dev/null +++ b/docs/source/validator.hed2.parser.parsedHed2Tag.rst @@ -0,0 +1,5 @@ +parsedHed2Tag +========= + +.. js:autoclass:: ParsedHed2Tag + :members: diff --git a/docs/source/validator.hed2.parser.rst b/docs/source/validator.hed2.parser.rst new file mode 100644 index 00000000..c1235721 --- /dev/null +++ b/docs/source/validator.hed2.parser.rst @@ -0,0 +1,7 @@ +parser +====== + +.. toctree:: + :maxdepth: 8 + + validator.hed2.parser.parsedHed2Tag \ No newline at end of file diff --git a/docs/source/validator.hed2.rst b/docs/source/validator.hed2.rst new file mode 100644 index 00000000..8d1170d0 --- /dev/null +++ b/docs/source/validator.hed2.rst @@ -0,0 +1,9 @@ +hed2 +==== + +.. toctree:: + :maxdepth: 8 + + validator.hed2.schema + validator.hed2.event + validator.hed2.parser \ No newline at end of file diff --git a/docs/source/validator.hed2.schema.hed2SchemaParser.rst b/docs/source/validator.hed2.schema.hed2SchemaParser.rst new file mode 100644 index 00000000..71b26067 --- /dev/null +++ b/docs/source/validator.hed2.schema.hed2SchemaParser.rst @@ -0,0 +1,5 @@ +hed2SchemaParser +================ + +.. js:autoclass:: Hed2SchemaParser + :members: diff --git a/docs/source/validator.hed2.schema.rst b/docs/source/validator.hed2.schema.rst new file mode 100644 index 00000000..7e969611 --- /dev/null +++ b/docs/source/validator.hed2.schema.rst @@ -0,0 +1,8 @@ +schema +====== + +.. toctree:: + :maxdepth: 8 + + validator.hed2.schema.schemaAttributes + validator.hed2.schema.hed2SchemaParser \ No newline at end of file diff --git a/docs/source/validator.hed2.schema.schemaAttributes.rst b/docs/source/validator.hed2.schema.schemaAttributes.rst new file mode 100644 index 00000000..636ac687 --- /dev/null +++ b/docs/source/validator.hed2.schema.schemaAttributes.rst @@ -0,0 +1,5 @@ +schemaAttributes +================ + +.. js:autoclass:: SchemaAttributes + :members: \ No newline at end of file diff --git a/docs/source/validator.parser.main.rst b/docs/source/validator.parser.main.rst new file mode 100644 index 00000000..2f0fae59 --- /dev/null +++ b/docs/source/validator.parser.main.rst @@ -0,0 +1,16 @@ +main +========= + +.. js:autofunction:: substituteCharacters + +.. js:autofunction:: countTagGroupParentheses + +.. js:autofunction:: isCommaMissingAfterClosingParenthesis + +.. js:autofunction:: findDelimiterIssuesInHedString + +.. js:autofunction:: validateFullUnparsedHedString + +.. js:autofunction:: parseHedString + +.. js:autofunction:: parseHedStrings diff --git a/docs/source/validator.parser.parsedHedGroup.rst b/docs/source/validator.parser.parsedHedGroup.rst new file mode 100644 index 00000000..218d5efa --- /dev/null +++ b/docs/source/validator.parser.parsedHedGroup.rst @@ -0,0 +1,5 @@ +parsedHedGroup +============== + +.. js:autoclass:: ParsedHedGroup + :members: \ No newline at end of file diff --git a/docs/source/validator.parser.parsedHedString.rst b/docs/source/validator.parser.parsedHedString.rst new file mode 100644 index 00000000..1fbfa09a --- /dev/null +++ b/docs/source/validator.parser.parsedHedString.rst @@ -0,0 +1,5 @@ +parsedHedString +=============== + +.. js:autoclass:: ParsedHedString + :members: \ No newline at end of file diff --git a/docs/source/validator.parser.parsedHedSubstring.rst b/docs/source/validator.parser.parsedHedSubstring.rst new file mode 100644 index 00000000..e2e017e8 --- /dev/null +++ b/docs/source/validator.parser.parsedHedSubstring.rst @@ -0,0 +1,5 @@ +parsedHedSubstring +================== + +.. js:autoclass:: ParsedHedSubstring + :members: \ No newline at end of file diff --git a/docs/source/validator.parser.parsedHedTag.rst b/docs/source/validator.parser.parsedHedTag.rst new file mode 100644 index 00000000..f6ac6486 --- /dev/null +++ b/docs/source/validator.parser.parsedHedTag.rst @@ -0,0 +1,8 @@ +parsedHedTag +=============== + +.. js:autoclass:: ParsedHedTag + :members: + +.. js:autoclass:: ParsedHed3Tag + :members: \ No newline at end of file diff --git a/docs/source/validator.parser.rst b/docs/source/validator.parser.rst new file mode 100644 index 00000000..676d7570 --- /dev/null +++ b/docs/source/validator.parser.rst @@ -0,0 +1,12 @@ +parser +====== + +.. toctree:: + :maxdepth: 8 + + validator.parser.parsedHedTag + validator.parser.splitHedString + validator.parser.parsedHedString + validator.parser.parsedHedSubstring + validator.parser.parsedHedGroup + validator.parser.main \ No newline at end of file diff --git a/docs/source/validator.parser.splitHedString.rst b/docs/source/validator.parser.splitHedString.rst new file mode 100644 index 00000000..b7fdec82 --- /dev/null +++ b/docs/source/validator.parser.splitHedString.rst @@ -0,0 +1,11 @@ +splitHedString +=============== + +.. js:autoclass:: HedStringTokenizer + :members: + +.. js:autofunction:: checkForInvalidCharacters + +.. js:autofunction:: createParsedTags + +.. js:autofunction:: splitHedString diff --git a/docs/source/validator.rst b/docs/source/validator.rst new file mode 100644 index 00000000..e4434167 --- /dev/null +++ b/docs/source/validator.rst @@ -0,0 +1,11 @@ +validator +========= + +.. toctree:: + :maxdepth: 8 + + validator.dataset + validator.schema + validator.event + validator.parser + validator.hed2 \ No newline at end of file diff --git a/docs/source/validator.schema.hed3.rst b/docs/source/validator.schema.hed3.rst new file mode 100644 index 00000000..270170d8 --- /dev/null +++ b/docs/source/validator.schema.hed3.rst @@ -0,0 +1,3 @@ +hed3 +==== +Intentionally blank for now \ No newline at end of file diff --git a/docs/source/validator.schema.init.rst b/docs/source/validator.schema.init.rst new file mode 100644 index 00000000..20c41991 --- /dev/null +++ b/docs/source/validator.schema.init.rst @@ -0,0 +1,12 @@ +init +=============== + +.. js:autofunction:: isHed3Schema + +.. js:autofunction:: buildSchemaAttributesObject + +.. js:autofunction:: buildSchemaObject + + .. js:autofunction:: init.buildSchema + +.. js:autofunction:: buildSchemas diff --git a/docs/source/validator.schema.parser.rst b/docs/source/validator.schema.parser.rst new file mode 100644 index 00000000..bf9e57a9 --- /dev/null +++ b/docs/source/validator.schema.parser.rst @@ -0,0 +1,5 @@ +parser +=============== + +.. js:autoclass:: SchemaParser + :members: diff --git a/docs/source/validator.schema.rst b/docs/source/validator.schema.rst new file mode 100644 index 00000000..f453677b --- /dev/null +++ b/docs/source/validator.schema.rst @@ -0,0 +1,10 @@ +schema +====== + +.. toctree:: + :maxdepth: 8 + + validator.schema.init + validator.schema.types + validator.schema.parser + validator.schema.hed3 \ No newline at end of file diff --git a/docs/source/validator.schema.types.rst b/docs/source/validator.schema.types.rst new file mode 100644 index 00000000..a7c0ccb5 --- /dev/null +++ b/docs/source/validator.schema.types.rst @@ -0,0 +1,35 @@ +types +=============== + +.. js:autoclass:: SchemaEntries + :members: + +.. js:autoclass:: SchemaEntryManager + :members: + +.. js:autoclass:: SchemaEntry + :members: + +.. js:autoclass:: SchemaProperty + :members: + +.. js:autoclass:: SchemaAttribute + :members: + +.. js:autoclass:: SchemaEntryWithAttributes + :members: + +.. js:autoclass:: SchemaUnit + :members: + +.. js:autoclass:: SchemaUnitClass + :members: + +.. js:autoclass:: SchemaUnitModifier + :members: + +.. js:autoclass:: SchemaValueClass + :members: + +.. js:autoclass:: SchemaTag + :members: diff --git a/package-lock.json b/package-lock.json index a954b948..6adebe43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,17 +54,89 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.18.13", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.13.tgz", @@ -114,13 +186,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.13.tgz", - "integrity": "sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.13", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "engines": { @@ -169,34 +242,34 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz", - "integrity": "sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.18.6", - "@babel/types": "^7.18.9" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -255,30 +328,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", - "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -308,13 +381,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -393,9 +466,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.13.tgz", - "integrity": "sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -567,33 +640,33 @@ } }, "node_modules/@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.13.tgz", - "integrity": "sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.13", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.18.13", - "@babel/types": "^7.18.13", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -611,13 +684,13 @@ } }, "node_modules/@babel/types": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.13.tgz", - "integrity": "sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1030,13 +1103,13 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@nodelib/fs.scandir": { @@ -6168,12 +6241,71 @@ } }, "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/compat-data": { @@ -6214,13 +6346,14 @@ } }, "@babel/generator": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.13.tgz", - "integrity": "sha512-CkPg8ySSPuHTYPJYo7IRALdqyjM9HCbt/3uOBEFbzyGVP6Mn8bwFPB0jX6982JVNBlYzM1nnPkfjuXSOPtQeEQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.18.13", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "dependencies": { @@ -6258,28 +6391,28 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true }, "@babel/helper-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz", - "integrity": "sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/template": "^7.18.6", - "@babel/types": "^7.18.9" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-imports": { @@ -6323,24 +6456,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz", - "integrity": "sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", - "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -6361,13 +6494,13 @@ } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -6430,9 +6563,9 @@ } }, "@babel/parser": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.13.tgz", - "integrity": "sha512-dgXcIfMuQ0kgzLB2b9tRZs7TTFFaGM2AbtA4fJgUUYukzGH4jwsS7hzQHEGs67jdehpm22vkgKwvbU+aEflgwg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -6553,30 +6686,30 @@ } }, "@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.13.tgz", - "integrity": "sha512-N6kt9X1jRMLPxxxPYWi7tgvJRH/rtoU+dbKAPDM44RFHiMH8igdsaSBgFeskhSl/kLWLDUvIh1RXCrTmg0/zvA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.13", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.18.13", - "@babel/types": "^7.18.13", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -6590,13 +6723,13 @@ } }, "@babel/types": { - "version": "7.18.13", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.13.tgz", - "integrity": "sha512-ePqfTihzW0W6XAU+aMw2ykilisStJfDnsejDCXRchCcMJ4O0+8DhPXf2YUbZ6wjBlsEmZwLK/sPweWtu8hcJYQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.18.10", - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -6919,13 +7052,13 @@ "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@nodelib/fs.scandir": { diff --git a/readthedocs.yml b/readthedocs.yml index 0c731bf7..4354290b 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -5,10 +5,14 @@ formats: - pdf build: - os: ubuntu-22.04 + os: 'ubuntu-22.04' tools: - python: '3.8' + python: '3.7' nodejs: '18' + jobs: + post_install: + - npm ci + - npm install -g jsdoc # Build documentation in the docs/ directory with Sphinx sphinx: @@ -19,6 +23,3 @@ sphinx: python: install: - requirements: docs/requirements.txt - - method: pip - path: . - system_packages: true diff --git a/tests/bids.spec.js b/tests/bids.spec.js index 51947732..a11856c0 100644 --- a/tests/bids.spec.js +++ b/tests/bids.spec.js @@ -749,7 +749,7 @@ describe('BIDS datasets', () => { * @param {Object} testDatasets The datasets to test with. * @param {Object} expectedIssues The expected issues. * @param {SchemasSpec} versionSpec The schema version to test with. - * @return {Promise} + * @returns {Promise} */ const validator = (testDatasets, expectedIssues, versionSpec) => { return Promise.all( diff --git a/utils/array.js b/utils/array.js index b47a3e4d..11ed80ff 100644 --- a/utils/array.js +++ b/utils/array.js @@ -20,7 +20,7 @@ export const getElementCount = function (array, elementToCount) { * * @template T * @param {T|T[]} array An array or scalar. - * @return {T[]} The original array or a singleton array of the scalar. + * @returns {T[]} The original array or a singleton array of the scalar. */ export const asArray = function (array) { return Array.isArray(array) ? array : [array] diff --git a/utils/files.js b/utils/files.js index 7e827e6b..eb0adde2 100644 --- a/utils/files.js +++ b/utils/files.js @@ -5,7 +5,7 @@ import request from 'then-request' * Read a local file. * * @param {string} fileName The file path. - * @return {Promise} A promise with the file contents. + * @returns {Promise} A promise with the file contents. */ export const readFile = function (fileName) { return new Promise((resolve) => { @@ -19,7 +19,7 @@ export const readFile = function (fileName) { * Read a remote file using HTTPS. * * @param {string} url The remote URL. - * @return {Promise} A promise with the file contents. + * @returns {Promise} A promise with the file contents. */ export const readHTTPSFile = function (url) { return request('GET', url).then((res) => res.getBody()) diff --git a/utils/hedData.js b/utils/hedData.js index 94aef646..0e7427c9 100644 --- a/utils/hedData.js +++ b/utils/hedData.js @@ -6,7 +6,7 @@ import { ParsedHed3Tag } from '../validator/parser/parsedHedTag' * Determine the HED generation for a base schema version number. * * @param {string} version A HED base schema version number. - * @return {number} The HED generation the base schema belongs to. + * @returns {number} The HED generation the base schema belongs to. */ export const getGenerationForSchemaVersion = function (version) { if (lt(version, '4.0.0')) { @@ -29,7 +29,7 @@ export const mergeParsingIssues = function (previousIssues, currentIssues) { * * @param {Schemas} hedSchemas The HED schema collection. * @param {string} shortTag A short-form HED 3 tag. - * @return {Map} A Map mapping a {@link Schema} to a {@link ParsedHedTag} object representing the full tag. + * @returns {Map} A Map mapping a {@link Schema} to a {@link ParsedHedTag} object representing the full tag. */ export const getParsedParentTags = function (hedSchemas, shortTag) { const parentTags = new Map() diff --git a/utils/hedStrings.js b/utils/hedStrings.js index 8f6318d3..f09aaad2 100644 --- a/utils/hedStrings.js +++ b/utils/hedStrings.js @@ -29,7 +29,7 @@ const getTagSlashIndices = function (tag) { * Get the levels of a tag. * * @param {string} tag A HED tag string. - * @return {string[]} The levels of this tag. + * @returns {string[]} The levels of this tag. */ export const getTagLevels = function (tag) { const tagSlashIndices = getTagSlashIndices(tag) @@ -41,7 +41,7 @@ export const getTagLevels = function (tag) { * * @param {string} tag A HED tag * @param {string} character The character to use as a separator. - * @return {string} The last part of the tag using the given separator. + * @returns {string} The last part of the tag using the given separator. */ export const getTagName = function (tag, character = '/') { const lastSlashIndex = tag.lastIndexOf(character) diff --git a/utils/map.js b/utils/map.js index 31cc7bf8..91a761e5 100644 --- a/utils/map.js +++ b/utils/map.js @@ -6,7 +6,7 @@ import isEqual from 'lodash/isEqual' * @template K,V * @param {[K,V][]} list A list of key-value pairs. * @param {function(V, V): boolean} equalityFunction An equality function for the value data. - * @return {[Map, [K,V][]]} A map and any non-equal duplicate keys found. + * @returns {[Map, [K,V][]]} A map and any non-equal duplicate keys found. */ export const filterNonEqualDuplicates = function (list, equalityFunction = isEqual) { const map = new Map() diff --git a/utils/string.js b/utils/string.js index f9ddd923..443d91d2 100644 --- a/utils/string.js +++ b/utils/string.js @@ -39,7 +39,7 @@ export const capitalizeString = function (string) { * Determine if a string is a valid clock face time. * * @param {string} timeString The string to check. - * @return {boolean} Whether the string is a valid clock face time. + * @returns {boolean} Whether the string is a valid clock face time. */ export const isClockFaceTime = function (timeString) { return date.isValid(timeString, 'HH:mm') || date.isValid(timeString, 'HH:mm:ss') @@ -49,7 +49,7 @@ export const isClockFaceTime = function (timeString) { * Determine if a string is a valid date-time. * * @param {string} dateTimeString The string to check. - * @return {boolean} Whether the string is a valid date-time. + * @returns {boolean} Whether the string is a valid date-time. */ export const isDateTime = function (dateTimeString) { return dateIsValid(parseISO(dateTimeString)) && rfc3339ish.test(dateTimeString) @@ -59,7 +59,7 @@ export const isDateTime = function (dateTimeString) { * Determine if a string is a valid number. * * @param {string} numericString The string to check. - * @return {boolean} Whether the string is a valid number. + * @returns {boolean} Whether the string is a valid number. */ export const isNumber = function (numericString) { return digitExpression.test(numericString) @@ -72,7 +72,7 @@ export const isNumber = function (numericString) { * * @param {string[]} strings The literal parts of the template string. * @param {(number|string)} keys The keys of the closure arguments. - * @return {function(...[*]): string} A closure to fill the string template. + * @returns {function(...[*]): string} A closure to fill the string template. */ export const stringTemplate = function (strings, ...keys) { return function (...values) { diff --git a/utils/types.js b/utils/types.js index cef2076a..facb7eec 100644 --- a/utils/types.js +++ b/utils/types.js @@ -16,7 +16,7 @@ export const MemoizerMixin = (Base) => { * @template T * @param {string} propertyName The property name * @param {function() : T} valueComputer A function to compute the value. - * @return {T} The computed value. + * @returns {T} The computed value. * @protected */ _memoize(propertyName, valueComputer) { @@ -33,4 +33,7 @@ export const MemoizerMixin = (Base) => { } } +/** + * Memoizer class + */ export class Memoizer extends MemoizerMixin(Object) {} diff --git a/utils/xpath.js b/utils/xpath.js index 4e242573..4cdb41d7 100644 --- a/utils/xpath.js +++ b/utils/xpath.js @@ -18,7 +18,7 @@ const childToParent = { * * @param {object} element An xml2js element. * @param {string} query An XPath query. - * @return {object[]} An array of xml2js elements matching the query. + * @returns {object[]} An array of xml2js elements matching the query. */ export const find = function (element, query) { const { elementName, attributeName } = parseXPath(query) @@ -38,7 +38,7 @@ export const find = function (element, query) { * This is a minimal parser only suitable for this package. * * @param {string} query An XPath query. - * @return {object} The parsed search parameters. + * @returns {object} The parsed search parameters. */ const parseXPath = function (query) { const nodeQuery = /^\/\/(\w+)$/ @@ -66,7 +66,7 @@ const parseXPath = function (query) { * @param {object} element An xml2js element. * @param {string} elementName The element name. * @param {string} attributeName The attribute name. - * @return {object[]} An array of xml2js elements with the given name and attribute. + * @returns {object[]} An array of xml2js elements with the given name and attribute. */ const search = function (element, elementName, attributeName) { let result = [] diff --git a/validator/dataset.js b/validator/dataset.js index 22536df5..05549be9 100644 --- a/validator/dataset.js +++ b/validator/dataset.js @@ -9,7 +9,7 @@ import { filterNonEqualDuplicates } from '../utils/map' * Parse the dataset's definitions and evaluate labels in the dataset. * * @param {ParsedHedString[]} parsedHedStrings The dataset's parsed HED strings. - * @return {[Map, Issue[]]} The definition map and any issues found. + * @returns {[Map, Issue[]]} The definition map and any issues found. */ export const parseDefinitions = function (parsedHedStrings) { const issues = [] @@ -66,7 +66,7 @@ const checkGroupForTemporalOrder = (parsedGroup, activeScopes) => { * * @param {ParsedHedString[]} hedStrings The dataset's HED strings. * @param {Schemas} hedSchemas The HED schema container object. - * @return {Issue[]} Any issues found. + * @returns {Issue[]} Any issues found. */ export const validateTemporalOrder = function (hedStrings, hedSchemas) { const issues = [] @@ -99,7 +99,7 @@ export const validateTemporalOrder = function (hedStrings, hedSchemas) { * @param {Definitions} definitions The parsed dataset definitions. * @param {ParsedHedString[]} hedStrings The dataset's HED strings. * @param {Schemas} hedSchemas The HED schema container object. - * @return {Issue[]} Whether the HED dataset is valid and any issues found. + * @returns {Issue[]} Whether the HED dataset is valid and any issues found. */ export const validateDataset = function (definitions, hedStrings, hedSchemas) { // TODO: Implement @@ -110,7 +110,7 @@ export const validateDataset = function (definitions, hedStrings, hedSchemas) { /** * Validate a group of HED strings. * - * @param {(string|ParsedHedString)[]} parsedHedStrings The dataset's parsed HED strings. + * @param {(string[]|ParsedHedString[])} parsedHedStrings The dataset's parsed HED strings. * @param {Schemas} hedSchemas The HED schema container object. * @param {Map} definitions The dataset's parsed definitions. * @param {Object} settings The configuration settings for validation. diff --git a/validator/event/hed3.js b/validator/event/hed3.js index 0a92a29e..c13d6bbf 100644 --- a/validator/event/hed3.js +++ b/validator/event/hed3.js @@ -13,6 +13,9 @@ import ParsedHedColumnSplice from '../parser/parsedHedColumnSplice' const tagGroupType = 'tagGroup' const topLevelTagGroupType = 'topLevelTagGroup' +/** + * Hed3Validator class + */ export class Hed3Validator extends HedValidator { /** * The parsed definitions. @@ -279,7 +282,7 @@ export class Hed3Validator extends HedValidator { /** * Validate a unit and strip it from the value. * @param {ParsedHed3Tag} tag A HED tag. - * @return {[boolean, boolean, string]} Whether a unit was found, whether it was valid, and the stripped value. + * @returns {[boolean, boolean, string]} Whether a unit was found, whether it was valid, and the stripped value. */ validateUnits(tag) { const originalTagUnitValue = tag.originalTagName diff --git a/validator/event/init.js b/validator/event/init.js index 77a9dbef..c9e5544f 100644 --- a/validator/event/init.js +++ b/validator/event/init.js @@ -14,7 +14,7 @@ import { Issue } from '../../common/issues/issues' * @param {Schemas} hedSchemas The HED schemas to validate against. * @param {Object} options Any validation options passed in. * @param {Map?} definitions The definitions for this HED dataset. - * @return {[ParsedHedString, Issue[], HedValidator]} The parsed HED string, the actual HED schema collection to use, any issues found, and whether to perform semantic validation. + * @returns {[ParsedHedString, Issue[], HedValidator]} The parsed HED string, the actual HED schema collection to use, any issues found, and whether to perform semantic validation. */ const initiallyValidateHedString = function (hedString, hedSchemas, options, definitions = null) { const doSemanticValidation = hedSchemas instanceof Schemas diff --git a/validator/event/validator.js b/validator/event/validator.js index e47605ed..652f0894 100644 --- a/validator/event/validator.js +++ b/validator/event/validator.js @@ -9,7 +9,9 @@ const requiredType = 'required' const requireChildType = 'requireChild' // Validation tests - +/** + * HedValidator class + */ export class HedValidator { /** * The parsed HED string to be validated. diff --git a/validator/hed2/event/hed2Validator.js b/validator/hed2/event/hed2Validator.js index 4f2d1a2a..e043f888 100644 --- a/validator/hed2/event/hed2Validator.js +++ b/validator/hed2/event/hed2Validator.js @@ -6,6 +6,9 @@ const clockTimeUnitClass = 'clockTime' const dateTimeUnitClass = 'dateTime' const timeUnitClass = 'time' +/** + * Hed2Validator class + */ export class Hed2Validator extends HedValidator { constructor(parsedString, hedSchemas, options) { super(parsedString, hedSchemas, options) @@ -104,7 +107,7 @@ export class Hed2Validator extends HedValidator { * * @param {string} value The stripped value. * @param {boolean} isNumeric Whether the tag is numeric. - * @return {boolean} Whether the stripped value is valid. + * @returns {boolean} Whether the stripped value is valid. */ validateValue(value, isNumeric) { if (value === '#') { diff --git a/validator/hed2/event/units.js b/validator/hed2/event/units.js index 79bf0fd1..138cc5e6 100644 --- a/validator/hed2/event/units.js +++ b/validator/hed2/event/units.js @@ -13,7 +13,7 @@ const SIUnitSymbolModifierKey = 'SIUnitSymbolModifier' * @param {string} originalTagUnitValue The unformatted version of the value. * @param {string[]} tagUnitClassUnits The list of valid units for this tag. * @param {SchemaAttributes} hedSchemaAttributes The collection of schema attributes. - * @return {[boolean, boolean, string]} Whether a unit was found, whether it was valid, and the stripped value. + * @returns {[boolean, boolean, string]} Whether a unit was found, whether it was valid, and the stripped value. */ export const validateUnits = function (originalTagUnitValue, tagUnitClassUnits, hedSchemaAttributes) { const validUnits = getAllUnits(hedSchemaAttributes) @@ -64,7 +64,7 @@ export const validateUnits = function (originalTagUnitValue, tagUnitClassUnits, * * @param {string} unit A unit string. * @param {SchemaAttributes} hedSchemaAttributes The collection of schema attributes. - * @return {boolean} Whether the unit is a valid prefix unit. + * @returns {boolean} Whether the unit is a valid prefix unit. */ const isPrefixUnit = function (unit, hedSchemaAttributes) { if (unitPrefixType in hedSchemaAttributes.unitAttributes) { @@ -79,7 +79,7 @@ const isPrefixUnit = function (unit, hedSchemaAttributes) { * * @param {string} unit A unit string. * @param {SchemaAttributes} hedSchemaAttributes The collection of schema attributes. - * @return {string[]} The list of valid derivative units. + * @returns {string[]} The list of valid derivative units. */ const getValidDerivativeUnits = function (unit, hedSchemaAttributes) { const pluralUnits = [unit] diff --git a/validator/hed2/parser/parsedHed2Tag.js b/validator/hed2/parser/parsedHed2Tag.js index e487646b..08f21cb2 100644 --- a/validator/hed2/parser/parsedHed2Tag.js +++ b/validator/hed2/parser/parsedHed2Tag.js @@ -1,6 +1,9 @@ import { replaceTagNameWithPound } from '../../../utils/hedStrings' import { ParsedHedTag } from '../../parser/parsedHedTag' +/** + * ParsedHedTag class + */ export class ParsedHed2Tag extends ParsedHedTag { /** * Convert this tag to long form. @@ -95,7 +98,7 @@ export class ParsedHed2Tag extends ParsedHedTag { /** * Get the legal units for a particular HED tag. - * @return {string[]} + * @returns {string[]} */ get validUnits() { return this._memoize('validUnits', () => { diff --git a/validator/hed2/schema/hed2SchemaParser.js b/validator/hed2/schema/hed2SchemaParser.js index dd05dbb1..bc8cad6c 100644 --- a/validator/hed2/schema/hed2SchemaParser.js +++ b/validator/hed2/schema/hed2SchemaParser.js @@ -38,6 +38,9 @@ const unitModifierElement = 'unitModifier' const lc = (str) => str.toLowerCase() +/** + * Hed2SchemaParser class + */ export class Hed2SchemaParser extends SchemaParser { parse() { this.populateDictionaries() diff --git a/validator/hed2/schema/schemaAttributes.js b/validator/hed2/schema/schemaAttributes.js index 1e04646b..3edf4143 100644 --- a/validator/hed2/schema/schemaAttributes.js +++ b/validator/hed2/schema/schemaAttributes.js @@ -69,7 +69,7 @@ export class SchemaAttributes { * * @param {string} tag The HED tag to check. * @param {string} tagAttribute The attribute to check for. - * @return {boolean|null} Whether this tag has this attribute, or null if the attribute doesn't exist. + * @returns {boolean|null} Whether this tag has this attribute, or null if the attribute doesn't exist. */ tagHasAttribute(tag, tagAttribute) { if (!(tagAttribute in this.tagAttributes)) { diff --git a/validator/parser/main.js b/validator/parser/main.js index f4daf6bd..740706f7 100644 --- a/validator/parser/main.js +++ b/validator/parser/main.js @@ -124,7 +124,7 @@ const findDelimiterIssuesInHedString = function (hedString) { * Validate the full unparsed HED string. * * @param {string} hedString The unparsed HED string. - * @return {Object} String substitution issues and other issues. + * @returns {Object} String substitution issues and other issues. */ const validateFullUnparsedHedString = function (hedString) { const [fixedHedString, substitutionIssues] = substituteCharacters(hedString) @@ -166,7 +166,7 @@ export const parseHedString = function (hedString, hedSchemas) { * * @param {string[]} hedStrings A set of HED strings. * @param {Schemas} hedSchemas The collection of HED schemas. - * @return {[ParsedHedString[], Object]} The parsed HED strings and any issues found. + * @returns {[ParsedHedString[], Object]} The parsed HED strings and any issues found. */ export const parseHedStrings = function (hedStrings, hedSchemas) { return hedStrings diff --git a/validator/parser/parsedHedGroup.js b/validator/parser/parsedHedGroup.js index 3ed1dd55..712d0e9b 100644 --- a/validator/parser/parsedHedGroup.js +++ b/validator/parser/parsedHedGroup.js @@ -10,7 +10,7 @@ import ParsedHedColumnSplice from './parsedHedColumnSplice' /** * A parsed HED tag group. */ -export default class ParsedHedGroup extends ParsedHedSubstring { +export class ParsedHedGroup extends ParsedHedSubstring { static SPECIAL_SHORT_TAGS = new Set(['Definition', 'Def', 'Def-expand', 'Onset', 'Offset', 'Inset']) /** @@ -67,7 +67,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { * @param {ParsedHedGroup} group The parsed HED tag group. * @param {Schemas} hedSchemas The collection of HED schemas. * @param {string} shortTag The short tag to search for. - * @return {null|ParsedHedTag[]} The tag(s) matching the short tag. + * @returns {null|ParsedHedTag[]} The tag(s) matching the short tag. */ static findGroupTags(group, hedSchemas, shortTag) { if (!hedSchemas.isHed3) { @@ -91,7 +91,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * The {@code Definition} tags associated with this HED tag group. - * @return {ParsedHedTag[]} + * @returns {ParsedHedTag[]} */ get definitionTags() { return this.specialTags.get('Definition') @@ -99,7 +99,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * The {@code Def} tags associated with this HED tag group. - * @return {ParsedHedTag[]} + * @returns {ParsedHedTag[]} */ get defTags() { return this.specialTags.get('Def') @@ -107,7 +107,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * The {@code Def-expand} tags associated with this HED tag group. - * @return {ParsedHedTag[]} + * @returns {ParsedHedTag[]} */ get defExpandTags() { return this.specialTags.get('Def-expand') @@ -115,7 +115,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * Whether this HED tag group is a definition group. - * @return {boolean} + * @returns {boolean} */ get isDefinitionGroup() { return this.specialTags.has('Definition') @@ -123,7 +123,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * Whether this HED tag group has a {@code Def} tag. - * @return {boolean} + * @returns {boolean} */ get isDefGroup() { return this.specialTags.has('Def') @@ -131,7 +131,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * Whether this HED tag group has a {@code Def-expand} tag. - * @return {boolean} + * @returns {boolean} */ get isDefExpandGroup() { return this.specialTags.has('Def-expand') @@ -139,7 +139,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * Whether this HED tag group is an onset group. - * @return {boolean} + * @returns {boolean} */ get isOnsetGroup() { return this.specialTags.has('Onset') @@ -147,7 +147,7 @@ export default class ParsedHedGroup extends ParsedHedSubstring { /** * Whether this HED tag group is an offset group. - * @return {boolean} + * @returns {boolean} */ get isOffsetGroup() { return this.specialTags.has('Offset') @@ -534,3 +534,5 @@ export default class ParsedHedGroup extends ParsedHedSubstring { } } } + +export default ParsedHedGroup diff --git a/validator/parser/parsedHedString.js b/validator/parser/parsedHedString.js index 7c3ac4a5..30ca6248 100644 --- a/validator/parser/parsedHedString.js +++ b/validator/parser/parsedHedString.js @@ -5,7 +5,7 @@ import ParsedHedColumnSplice from './parsedHedColumnSplice' /** * A parsed HED string. */ -export default class ParsedHedString { +export class ParsedHedString { /** * The original HED string. * @type {string} @@ -76,3 +76,5 @@ export default class ParsedHedString { }) } } + +export default ParsedHedString diff --git a/validator/parser/parsedHedSubstring.js b/validator/parser/parsedHedSubstring.js index d2c6d971..6400a5a0 100644 --- a/validator/parser/parsedHedSubstring.js +++ b/validator/parser/parsedHedSubstring.js @@ -3,7 +3,7 @@ import { Memoizer } from '../../utils/types' /** * A parsed HED substring. */ -export default class ParsedHedSubstring extends Memoizer { +export class ParsedHedSubstring extends Memoizer { /** * The original pre-parsed version of the HED tag. * @type {string} @@ -30,9 +30,11 @@ export default class ParsedHedSubstring extends Memoizer { /** * Override of {@link Object.prototype.toString}. * - * @return {string} The original form of this HED substring. + * @returns {string} The original form of this HED substring. */ toString() { return this.originalTag } } + +export default ParsedHedSubstring diff --git a/validator/parser/parsedHedTag.js b/validator/parser/parsedHedTag.js index e608178f..115e76ba 100644 --- a/validator/parser/parsedHedTag.js +++ b/validator/parser/parsedHedTag.js @@ -48,7 +48,7 @@ export class ParsedHedTag extends ParsedHedSubstring { /** * Override of {@link Object.prototype.toString}. * - * @return {string} The original form of this HED tag. + * @returns {string} The original form of this HED tag. */ toString() { if (this.schema?.prefix) { @@ -104,7 +104,7 @@ export class ParsedHedTag extends ParsedHedSubstring { * Get the last part of a HED tag. * * @param {string} tagString A HED tag. - * @return {string} The last part of the tag using the given separator. + * @returns {string} The last part of the tag using the given separator. */ static getTagName(tagString) { const lastSlashIndex = tagString.lastIndexOf('/') @@ -215,6 +215,9 @@ export class ParsedHedTag extends ParsedHedSubstring { } } +/** + * A parsed HED3 tag. + */ export class ParsedHed3Tag extends ParsedHedTag { /** * Convert this tag to long form. @@ -342,7 +345,7 @@ export class ParsedHed3Tag extends ParsedHedTag { /** * Get the legal units for a particular HED tag. - * @return {Set} + * @returns {Set} */ get validUnits() { return this._memoize('validUnits', () => { @@ -361,7 +364,7 @@ export class ParsedHed3Tag extends ParsedHedTag { /** * Get the schema tag object for this tag's value-taking form. * - * @return {SchemaTag} + * @returns {SchemaTag} */ get takesValueTag() { return this._memoize('takesValueTag', () => { diff --git a/validator/parser/splitHedString.js b/validator/parser/splitHedString.js index 25318b7c..63a2a56d 100644 --- a/validator/parser/splitHedString.js +++ b/validator/parser/splitHedString.js @@ -61,6 +61,9 @@ class ColumnSpliceSpec { } } +/** + * Class for tokenizing HED strings. + */ class HedStringTokenizer { hedString syntaxIssues @@ -80,7 +83,7 @@ class HedStringTokenizer { /** * Split the HED string into delimiters and tags. * - * @return {[TagSpec[], GroupSpec, Object]} The tag specifications, group bounds, and any issues found. + * @returns {[TagSpec[], GroupSpec, Object]} The tag specifications, group bounds, and any issues found. */ tokenize() { this.initializeTokenizer() @@ -265,7 +268,7 @@ class HedStringTokenizer { * * @param {string} hedString The HED string to be split. * @param {TagSpec[]} tagSpecs The tag specifications. - * @return {Object} Any issues found. + * @returns {Object} Any issues found. */ const checkForInvalidCharacters = function (hedString, tagSpecs) { const syntaxIssues = [] @@ -320,7 +323,7 @@ const checkTagForInvalidCharacters = function (hedString, tagSpec, tag, invalidS * @param {Schemas} hedSchemas The collection of HED schemas. * @param {TagSpec[]} tagSpecs The tag specifications. * @param {GroupSpec} groupSpecs The bounds of the tag groups. - * @return {[ParsedHedSubstring[], Object]} The parsed HED string data and any issues found. + * @returns {[ParsedHedSubstring[], Object]} The parsed HED string data and any issues found. */ const createParsedTags = function (hedString, hedSchemas, tagSpecs, groupSpecs) { const conversionIssues = [] @@ -369,7 +372,7 @@ const createParsedTags = function (hedString, hedSchemas, tagSpecs, groupSpecs) * * @param {string} hedString The HED string to be split. * @param {Schemas} hedSchemas The collection of HED schemas. - * @return {[ParsedHedSubstring[], Object]} The parsed HED string data and any issues found. + * @returns {[ParsedHedSubstring[], Object]} The parsed HED string data and any issues found. */ export default function splitHedString(hedString, hedSchemas) { const [tagSpecs, groupBounds, splitIssues] = new HedStringTokenizer(hedString).tokenize() diff --git a/validator/schema/init.js b/validator/schema/init.js index a850c015..4171ebec 100644 --- a/validator/schema/init.js +++ b/validator/schema/init.js @@ -23,7 +23,7 @@ const isHed3Schema = function (xmlData) { * Build a schema attributes object from schema XML data. * * @param {object} xmlData The schema XML data. - * @return {SchemaAttributes|SchemaEntries} The schema attributes object. + * @returns {SchemaAttributes|SchemaEntries} The schema attributes object. */ export const buildSchemaAttributesObject = function (xmlData) { const rootElement = xmlData.HED @@ -56,7 +56,7 @@ const buildSchemaObject = function (xmlData) { * * @param {{path: string?, version: string?, libraries: Object?}} schemaDef The description of which schemas to use. * @param {boolean} useFallback Whether to use a bundled fallback schema if the requested schema cannot be loaded. - * @return {Promise|Promise} The schema container object or an error. + * @returns {Promise|Promise} The schema container object or an error. * @deprecated */ export const buildSchema = function (schemaDef = {}, useFallback = true) { @@ -84,7 +84,7 @@ export const buildSchema = function (schemaDef = {}, useFallback = true) { * Build a schema collection object from a schema specification. * * @param {Map|SchemasSpec} schemaSpecs The description of which schemas to use. - * @return {Promise|Promise<[Schemas, Issue[]]>} The schema container object and any issues found. + * @returns {Promise|Promise<[Schemas, Issue[]]>} The schema container object and any issues found. */ export const buildSchemas = function (schemaSpecs) { if (schemaSpecs instanceof SchemasSpec) { diff --git a/validator/schema/parser.js b/validator/schema/parser.js index 4a7c5892..61380d98 100644 --- a/validator/schema/parser.js +++ b/validator/schema/parser.js @@ -5,6 +5,9 @@ import flattenDeep from 'lodash/flattenDeep' // Temporary import * as xpath from '../../utils/xpath' +/** + * SchemaParser class + */ export class SchemaParser { constructor(rootElement) { this.rootElement = rootElement diff --git a/validator/schema/types.js b/validator/schema/types.js index ddd81f0f..21f5468e 100644 --- a/validator/schema/types.js +++ b/validator/schema/types.js @@ -5,6 +5,9 @@ pluralize.addUncountableRule('hertz') // Old-style types +/** + * SchemaEntries class + */ export class SchemaEntries extends Memoizer { /** * The schema's properties. @@ -35,7 +38,7 @@ export class SchemaEntries extends Memoizer { /** * Get the schema's unit classes. - * @return {SchemaEntryManager} + * @returns {SchemaEntryManager} */ get unitClassMap() { return this.definitions.get('unitClasses') @@ -57,7 +60,7 @@ export class SchemaEntries extends Memoizer { /** * Get the schema's SI unit modifiers. - * @return {Map} + * @returns {Map} */ get SIUnitModifiers() { const unitModifiers = this.definitions.get('unitModifiers') @@ -66,7 +69,7 @@ export class SchemaEntries extends Memoizer { /** * Get the schema's SI unit symbol modifiers. - * @return {Map} + * @returns {Map} */ get SIUnitSymbolModifiers() { const unitModifiers = this.definitions.get('unitModifiers') @@ -78,7 +81,7 @@ export class SchemaEntries extends Memoizer { * * @param {string} tag The HED tag to check. * @param {string} tagAttribute The attribute to check for. - * @return {boolean} Whether this tag has this attribute. + * @returns {boolean} Whether this tag has this attribute. */ tagHasAttribute(tag, tagAttribute) { if (!this.definitions.get('tags').hasEntry(tag)) { @@ -115,7 +118,7 @@ export class SchemaEntryManager extends Memoizer { /** * Iterator over the entry manager's entries. * - * @return {IterableIterator<[string, T]>} + * @returns {IterableIterator<[string, T]>} */ [Symbol.iterator]() { return this._definitions.entries() @@ -124,7 +127,7 @@ export class SchemaEntryManager extends Memoizer { /** * Iterator over the entry manager's keys. * - * @return {IterableIterator} + * @returns {IterableIterator} */ keys() { return this._definitions.keys() @@ -133,7 +136,7 @@ export class SchemaEntryManager extends Memoizer { /** * Iterator over the entry manager's keys. * - * @return {IterableIterator} + * @returns {IterableIterator} */ values() { return this._definitions.values() @@ -165,6 +168,9 @@ export class SchemaEntryManager extends Memoizer { } } +/** + * SchemaEntry class + */ export class SchemaEntry { /** * The name of this schema entry. @@ -178,7 +184,7 @@ export class SchemaEntry { /** * The name of this schema entry. - * @return {string} + * @returns {string} */ get name() { return this._name @@ -190,7 +196,7 @@ export class SchemaEntry { * This method is a stub to be overridden in {@link SchemaEntryWithAttributes}. * * @param {string} attributeName The attribute to check for. - * @return {boolean} Whether this schema entry has this attribute. + * @returns {boolean} Whether this schema entry has this attribute. */ // eslint-disable-next-line no-unused-vars hasAttributeName(attributeName) { @@ -203,6 +209,9 @@ const categoryProperty = 'categoryProperty' const typeProperty = 'typeProperty' const roleProperty = 'roleProperty' +/** + * A schema property. + */ export class SchemaProperty extends SchemaEntry { /** * The type of the property. @@ -217,7 +226,7 @@ export class SchemaProperty extends SchemaEntry { /** * Whether this property describes a schema category. - * @return {boolean} + * @returns {boolean} */ get isCategoryProperty() { return this._propertyType === categoryProperty @@ -225,7 +234,7 @@ export class SchemaProperty extends SchemaEntry { /** * Whether this property describes a data type. - * @return {boolean} + * @returns {boolean} */ get isTypeProperty() { return this._propertyType === typeProperty @@ -233,7 +242,7 @@ export class SchemaProperty extends SchemaEntry { /** * Whether this property describes a role. - * @return {boolean} + * @returns {boolean} */ get isRoleProperty() { return this._propertyType === roleProperty @@ -286,7 +295,7 @@ export class SchemaAttribute extends SchemaEntry { /** * The categories of elements this schema attribute applies to. - * @return {Set|SchemaProperty|undefined} + * @returns {Set|SchemaProperty|undefined} */ get categoryProperty() { switch (this._categoryProperties.size) { @@ -301,7 +310,7 @@ export class SchemaAttribute extends SchemaEntry { /** * The data type property of this schema attribute. - * @return {SchemaProperty} + * @returns {SchemaProperty} */ get typeProperty() { return this._typeProperty @@ -309,13 +318,16 @@ export class SchemaAttribute extends SchemaEntry { /** * The set of role properties for this schema attribute. - * @return {Set} + * @returns {Set} */ get roleProperties() { return new Set(this._roleProperties) } } +/** + * SchemaEntryWithAttributes class + */ class SchemaEntryWithAttributes extends SchemaEntry { /** * The set of boolean attributes this schema entry has. @@ -357,7 +369,7 @@ class SchemaEntryWithAttributes extends SchemaEntry { /** * Whether this schema entry has this attribute. * @param {SchemaAttribute} attribute The attribute to check for. - * @return {boolean} Whether this schema entry has this attribute. + * @returns {boolean} Whether this schema entry has this attribute. */ hasAttribute(attribute) { return this.booleanAttributes.has(attribute) @@ -367,7 +379,7 @@ class SchemaEntryWithAttributes extends SchemaEntry { * Retrieve the value of an attribute on this schema entry. * @param {SchemaAttribute} attribute The attribute whose value should be returned. * @param {boolean} alwaysReturnArray Whether to return a singleton array instead of a scalar value. - * @return {*} The value of the attribute. + * @returns {*} The value of the attribute. */ getAttributeValue(attribute, alwaysReturnArray = false) { return SchemaEntryWithAttributes._getMapArrayValue(this.valueAttributes, attribute, alwaysReturnArray) @@ -376,7 +388,7 @@ class SchemaEntryWithAttributes extends SchemaEntry { /** * Whether this schema entry has this attribute (by name). * @param {string} attributeName The attribute to check for. - * @return {boolean} Whether this schema entry has this attribute. + * @returns {boolean} Whether this schema entry has this attribute. */ hasAttributeName(attributeName) { return this.booleanAttributeNames.has(attributeName) @@ -386,7 +398,7 @@ class SchemaEntryWithAttributes extends SchemaEntry { * Retrieve the value of an attribute (by name) on this schema entry. * @param {string} attributeName The attribute whose value should be returned. * @param {boolean} alwaysReturnArray Whether to return a singleton array instead of a scalar value. - * @return {*} The value of the attribute. + * @returns {*} The value of the attribute. */ getNamedAttributeValue(attributeName, alwaysReturnArray = false) { return SchemaEntryWithAttributes._getMapArrayValue(this.valueAttributeNames, attributeName, alwaysReturnArray) @@ -412,6 +424,9 @@ class SchemaEntryWithAttributes extends SchemaEntry { } } +/** + * SchemaUnit class + */ export class SchemaUnit extends SchemaEntryWithAttributes { /** * The legal derivatives of this unit. @@ -461,6 +476,9 @@ export class SchemaUnit extends SchemaEntryWithAttributes { } } +/** + * SchemaUnitClass class + */ export class SchemaUnitClass extends SchemaEntryWithAttributes { /** * The units for this unit class. @@ -499,6 +517,9 @@ export class SchemaUnitClass extends SchemaEntryWithAttributes { } } +/** + * SchemaUnitModifier class + */ export class SchemaUnitModifier extends SchemaEntryWithAttributes { constructor(name, booleanAttributes, valueAttributes) { super(name, booleanAttributes, valueAttributes) @@ -513,6 +534,9 @@ export class SchemaUnitModifier extends SchemaEntryWithAttributes { } } +/** + * SchemaValueClass class + */ export class SchemaValueClass extends SchemaEntryWithAttributes { constructor(name, booleanAttributes, valueAttributes) { super(name, booleanAttributes, valueAttributes)