bids-validator-deno 2.3.1.dev0__tar.gz → 2.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/PKG-INFO +1 -1
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/deno.json +2 -1
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/pyproject.toml +1 -1
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/access.ts +11 -3
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/gzip.ts +1 -1
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/openers.ts +42 -6
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/context.ts +1 -1
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/walk.ts +3 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/memoize.ts +5 -5
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/bids.ts +2 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/LICENSE +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/README.md +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/pdm_build.py +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/.git-meta.json +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/bids-validator.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/access.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/browser.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/browser.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/deno.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/deno.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/dwi.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/dwi.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/filetree.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/filetree.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/gzip.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/ignore.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/ignore.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/inheritance.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/inheritance.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/json.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/json.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/nifti.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/nifti.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/openers.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/repo.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/repo.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/streams.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/streams.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/tiff.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/tiff.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/tsv.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/files/tsv.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/issues/datasetIssues.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/issues/datasetIssues.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/issues/list.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/issues/list.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/main.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/applyRules.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/applyRules.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/associations.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/associations.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/context.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/datatypes.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/datatypes.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/entities.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/entities.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/expressionLanguage.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/expressionLanguage.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/fixtures.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/tables.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/tables.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/walk.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/loadSchema.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/loadSchema.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/options.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/options.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/requestPermissions.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/summary/collectSubjectMetadata.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/summary/summary.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/summary/summary.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/README.md +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/bom-utf16.tsv +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/bom-utf8.json +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/generate-filenames.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/bids_examples.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/common.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/derivatives.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/empty_files.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/hed-integration.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/nifti_rules.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_dataset.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_filenames.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_headers.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/nullReadBytes.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/regression.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/schema-expression-language.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/simple-dataset.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/utils.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/check.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/columns.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/columns.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/filetree.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/issues.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/schema.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/types/validation-result.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/errors.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/logger.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/logger.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/objectPathHandler.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/output.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/utils/queue.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/bids.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/citation.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/citation.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameCase.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameCase.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameIdentify.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameIdentify.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameValidate.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameValidate.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/hed.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/internal/emptyFile.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/internal/unusedFile.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/json.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/validateFiles.test.ts +0 -0
- {bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/version.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bids/validator",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./src/bids-validator.ts",
|
|
6
6
|
"./main": "./src/main.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@libs/xml": "jsr:@libs/xml@^7.0.3",
|
|
38
38
|
"@mango/nifti": "npm:@bids/nifti-reader-js@^0.6.9",
|
|
39
39
|
"@std/assert": "jsr:@std/assert@^1.0.16",
|
|
40
|
+
"@std/async": "jsr:@std/async@^1.1.0",
|
|
40
41
|
"@std/fmt": "jsr:@std/fmt@^1.0.8",
|
|
41
42
|
"@std/fs": "jsr:@std/fs@^1.0.21",
|
|
42
43
|
"@std/io": "jsr:@std/io@^0.225.2",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type BIDSFile } from '../types/filetree.ts'
|
|
2
2
|
import { type Issue } from '../types/issues.ts'
|
|
3
|
+
import { filememoize } from '../utils/memoize.ts'
|
|
4
|
+
import { logger } from '../utils/logger.ts'
|
|
3
5
|
|
|
4
6
|
function IOErrorToIssue(err: { code: string; name: string }): Issue {
|
|
5
|
-
const subcode = err.name
|
|
6
7
|
let issueMessage: string | undefined = undefined
|
|
7
8
|
if (err.code === 'ENOENT' || err.code === 'ELOOP') {
|
|
8
9
|
issueMessage = 'Possible dangling symbolic link'
|
|
@@ -14,22 +15,29 @@ export async function openStream(
|
|
|
14
15
|
file: BIDSFile,
|
|
15
16
|
): Promise<ReadableStream<Uint8Array<ArrayBuffer>>> {
|
|
16
17
|
return file.stream().catch((err: any) => {
|
|
18
|
+
logger.debug(`Error opening stream from file ${file.path}: ${err}`)
|
|
17
19
|
throw { location: file.path, ...IOErrorToIssue(err) }
|
|
18
20
|
})
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
async function _readBytes(
|
|
22
24
|
file: BIDSFile,
|
|
23
25
|
size: number,
|
|
24
26
|
offset = 0,
|
|
25
27
|
): Promise<Uint8Array<ArrayBuffer>> {
|
|
26
28
|
return file.readBytes(size, offset).catch((err: any) => {
|
|
29
|
+
logger.debug(`Error reading bytes from file ${file.path}: ${err}`)
|
|
27
30
|
throw { location: file.path, ...IOErrorToIssue(err) }
|
|
28
31
|
})
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
export
|
|
34
|
+
export const readBytes = filememoize(_readBytes)
|
|
35
|
+
|
|
36
|
+
async function _readText(file: BIDSFile): Promise<string> {
|
|
32
37
|
return file.text().catch((err: any) => {
|
|
38
|
+
logger.debug(`Error reading text from file ${file.path}: ${err}`)
|
|
33
39
|
throw { location: file.path, ...IOErrorToIssue(err) }
|
|
34
40
|
})
|
|
35
41
|
}
|
|
42
|
+
|
|
43
|
+
export const readText = filememoize(_readText)
|
|
@@ -18,7 +18,7 @@ import { readBytes } from './access.ts'
|
|
|
18
18
|
*/
|
|
19
19
|
export async function parseGzip(
|
|
20
20
|
file: BIDSFile,
|
|
21
|
-
maxBytes: number =
|
|
21
|
+
maxBytes: number = 1024,
|
|
22
22
|
): Promise<Gzip | undefined> {
|
|
23
23
|
const buf = await readBytes(file, maxBytes)
|
|
24
24
|
const view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength)
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These classes implement stream, text and random bytes access to BIDS resources.
|
|
5
5
|
*/
|
|
6
|
+
import { retry } from '@std/async'
|
|
6
7
|
import { join } from '@std/path'
|
|
7
8
|
import { type FileOpener } from '../types/filetree.ts'
|
|
8
9
|
import { createUTF8Stream } from './streams.ts'
|
|
10
|
+
import { logger } from '../utils/logger.ts'
|
|
9
11
|
|
|
10
12
|
export class FsFileOpener implements FileOpener {
|
|
11
13
|
path: string
|
|
@@ -97,6 +99,15 @@ export class BrowserFileOpener implements FileOpener {
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
class HttpError extends Error {
|
|
103
|
+
status: number
|
|
104
|
+
|
|
105
|
+
constructor(status: number, message: string) {
|
|
106
|
+
super(`HTTP Error ${status}: ${message}`)
|
|
107
|
+
this.status = status
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
100
111
|
export class HTTPOpener implements FileOpener {
|
|
101
112
|
url: string
|
|
102
113
|
size: number
|
|
@@ -106,28 +117,53 @@ export class HTTPOpener implements FileOpener {
|
|
|
106
117
|
this.size = size
|
|
107
118
|
}
|
|
108
119
|
|
|
109
|
-
async _fetch(
|
|
110
|
-
|
|
120
|
+
async _fetch(options: RequestInit = {}): Promise<Response> {
|
|
121
|
+
// Fetch with retries, for transient errors
|
|
122
|
+
return retry(async () => {
|
|
123
|
+
const response = await fetch(this.url, options)
|
|
111
124
|
if (!response.ok || !response.body) {
|
|
112
|
-
throw new
|
|
125
|
+
throw new HttpError(response.status, response.statusText)
|
|
113
126
|
}
|
|
114
127
|
return response
|
|
128
|
+
}, {
|
|
129
|
+
isRetriable: (error) => {
|
|
130
|
+
logger.info(`Failed to fetch ${this.url}: ${error}, retrying`)
|
|
131
|
+
return (
|
|
132
|
+
error instanceof TypeError ||
|
|
133
|
+
error instanceof HttpError && (error.status == 429 || error.status >= 500)
|
|
134
|
+
)
|
|
135
|
+
},
|
|
115
136
|
})
|
|
116
137
|
}
|
|
117
138
|
|
|
118
139
|
async stream(): Promise<ReadableStream<Uint8Array<ArrayBuffer>>> {
|
|
140
|
+
// Streams should not timeout
|
|
119
141
|
return this._fetch().then((response) => response.body!)
|
|
120
142
|
}
|
|
121
143
|
|
|
122
144
|
async text(): Promise<string> {
|
|
123
|
-
|
|
145
|
+
// Timeout after 5 seconds and retry; many connections can result in timeouts
|
|
146
|
+
return await retry(
|
|
147
|
+
() => this._fetch({ signal: AbortSignal.timeout(5000) }).then((response) => response.text()),
|
|
148
|
+
{
|
|
149
|
+
isRetriable: (error) => error instanceof DOMException && error.name === 'TimeoutError',
|
|
150
|
+
},
|
|
151
|
+
)
|
|
124
152
|
}
|
|
125
153
|
|
|
126
154
|
async readBytes(size: number, offset = 0): Promise<Uint8Array<ArrayBuffer>> {
|
|
127
155
|
const headers = new Headers()
|
|
128
156
|
headers.append('Range', `bytes=${offset}-${offset + size - 1}`)
|
|
129
|
-
|
|
130
|
-
return
|
|
157
|
+
// Timeout after 5 seconds and retry; many connections can result in timeouts
|
|
158
|
+
return await retry(
|
|
159
|
+
() =>
|
|
160
|
+
this._fetch({ headers, signal: AbortSignal.timeout(5000) }).then((response) =>
|
|
161
|
+
response.bytes()
|
|
162
|
+
),
|
|
163
|
+
{
|
|
164
|
+
isRetriable: (error) => error instanceof DOMException && error.name === 'TimeoutError',
|
|
165
|
+
},
|
|
166
|
+
)
|
|
131
167
|
}
|
|
132
168
|
}
|
|
133
169
|
|
|
@@ -317,7 +317,7 @@ export class BIDSContext implements Context {
|
|
|
317
317
|
if (!this.extension.endsWith('.gz')) {
|
|
318
318
|
return
|
|
319
319
|
}
|
|
320
|
-
this.gzip = await parseGzip(this.file,
|
|
320
|
+
this.gzip = await parseGzip(this.file, 1024).catch((error) => {
|
|
321
321
|
logger.debug('Error parsing gzip header', error)
|
|
322
322
|
return undefined
|
|
323
323
|
})
|
|
@@ -4,6 +4,7 @@ import type { DatasetIssues } from '../issues/datasetIssues.ts'
|
|
|
4
4
|
import { NullFileOpener } from '../files/openers.ts'
|
|
5
5
|
import { loadTSV } from '../files/tsv.ts'
|
|
6
6
|
import { loadJSON } from '../files/json.ts'
|
|
7
|
+
import { readBytes, readText } from '../files/access.ts'
|
|
7
8
|
import { queuedAsyncIterator } from '../utils/queue.ts'
|
|
8
9
|
|
|
9
10
|
function* quickWalk(dir: FileTree): Generator<BIDSFile> {
|
|
@@ -54,6 +55,8 @@ async function* _walkFileTree(
|
|
|
54
55
|
yield () => {
|
|
55
56
|
loadTSV.cache.delete(fileTree.path)
|
|
56
57
|
loadJSON.cache.delete(fileTree.path)
|
|
58
|
+
readBytes.cache.delete(fileTree.path)
|
|
59
|
+
readText.cache.delete(fileTree.path)
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
|
|
@@ -17,11 +17,11 @@ export const memoize = <A extends any[], R>(
|
|
|
17
17
|
return cached
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function filememoize<F extends FileLike,
|
|
21
|
-
fn: (file: F, ...args:
|
|
22
|
-
): WithCache<(file: F, ...args:
|
|
23
|
-
const cache = new Map<string, Map<string,
|
|
24
|
-
const cached = function (this: any, file: F, ...args:
|
|
20
|
+
export function filememoize<F extends FileLike, A extends any[], R>(
|
|
21
|
+
fn: (file: F, ...args: A) => R,
|
|
22
|
+
): WithCache<(file: F, ...args: A) => R> {
|
|
23
|
+
const cache = new Map<string, Map<string, R>>()
|
|
24
|
+
const cached = function (this: any, file: F, ...args: A): R {
|
|
25
25
|
let subcache = cache.get(file.parent.path)
|
|
26
26
|
if (!subcache) {
|
|
27
27
|
subcache = new Map()
|
|
@@ -107,6 +107,7 @@ export async function validate(
|
|
|
107
107
|
return false
|
|
108
108
|
})
|
|
109
109
|
|
|
110
|
+
logger.info('Performing file-level validation...')
|
|
110
111
|
for await (const context of walkFileTree(dsContext, 20)) {
|
|
111
112
|
if (
|
|
112
113
|
dsContext.dataset_description.DatasetType == 'raw' &&
|
|
@@ -121,6 +122,7 @@ export async function validate(
|
|
|
121
122
|
await summary.update(context)
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
logger.info('Performing dataset-level validation...')
|
|
124
126
|
for (const check of perDSChecks) {
|
|
125
127
|
await check(schema as unknown as GenericSchema, dsContext)
|
|
126
128
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/issues/datasetIssues.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/associations.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/expressionLanguage.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/schema/expressionLanguage.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/setup/requestPermissions.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/summary/collectSubjectMetadata.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/generate-filenames.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/bids_examples.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/derivatives.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/empty_files.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/hed-integration.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/nifti_rules.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_dataset.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_filenames.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/tests/local/valid_headers.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/citation.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameCase.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameIdentify.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameIdentify.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameValidate.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/filenameValidate.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/internal/emptyFile.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/internal/unusedFile.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.3.1.dev0 → bids_validator_deno-2.3.2}/src/validators/validateFiles.test.ts
RENAMED
|
File without changes
|
|
File without changes
|