diff --git a/bids-validator/src/deps/path.ts b/bids-validator/src/deps/path.ts index 244fb7b25..0c24472c3 100644 --- a/bids-validator/src/deps/path.ts +++ b/bids-validator/src/deps/path.ts @@ -5,6 +5,7 @@ export { basename, dirname, extname, + posix, fromFileUrl, parse, SEPARATOR_PATTERN, diff --git a/bids-validator/src/files/browser.ts b/bids-validator/src/files/browser.ts index 44ebb6eb9..190a0cb8a 100644 --- a/bids-validator/src/files/browser.ts +++ b/bids-validator/src/files/browser.ts @@ -1,7 +1,7 @@ import { BIDSFile } from '../types/file.ts' import { FileTree } from '../types/filetree.ts' import { FileIgnoreRules } from './ignore.ts' -import { parse, join, SEPARATOR_PATTERN } from '../deps/path.ts' +import { parse, posix, SEPARATOR_PATTERN } from '../deps/path.ts' /** * Browser implement of BIDSFile wrapping native File/FileList types @@ -68,7 +68,7 @@ export function fileListToTree(files: File[]): Promise { } else { // Otherwise make a new level and continue if needed const newTree = new FileTree( - join(currentLevelTree.path, level), + posix.join(currentLevelTree.path, level), level, currentLevelTree, ) diff --git a/bids-validator/src/files/deno.ts b/bids-validator/src/files/deno.ts index ca15c4358..852e173a6 100644 --- a/bids-validator/src/files/deno.ts +++ b/bids-validator/src/files/deno.ts @@ -1,7 +1,7 @@ /** * Deno specific implementation for reading files */ -import { join, basename } from '../deps/path.ts' +import { posix, join, basename } from '../deps/path.ts' import { BIDSFile } from '../types/file.ts' import { FileTree } from '../types/filetree.ts' import { requestReadPermission } from '../setup/requestPermissions.ts' @@ -122,7 +122,7 @@ export async function _readFileTree( if (dirEntry.isFile || dirEntry.isSymlink) { const file = new BIDSFileDeno( rootPath, - join(relativePath, dirEntry.name), + posix.join(relativePath, dirEntry.name), ignore, ) // For .bidsignore, read in immediately and add the rules @@ -134,7 +134,7 @@ export async function _readFileTree( if (dirEntry.isDirectory) { const dirTree = await _readFileTree( rootPath, - join(relativePath, dirEntry.name), + posix.join(relativePath, dirEntry.name), ignore, tree, )