Skip to content

Commit

Permalink
fix(deps): deprecated path.separator.SEP
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 29, 2024
1 parent 242a148 commit 0c53ce5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bids-validator/src/deps/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export {
extname,
fromFileUrl,
parse,
SEPARATOR,
} from 'std/path/mod.ts'
export { SEP } from 'std/path/separator.ts'
4 changes: 2 additions & 2 deletions bids-validator/src/files/browser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BIDSFile } from '../types/file.ts'
import { FileTree } from '../types/filetree.ts'
import { FileIgnoreRules } from './ignore.ts'
import { parse, join, SEP } from '../deps/path.ts'
import { parse, join, SEPARATOR } from '../deps/path.ts'

/**
* Browser implement of BIDSFile wrapping native File/FileList types
Expand Down Expand Up @@ -60,7 +60,7 @@ export function fileListToTree(files: File[]): Promise<FileTree> {
// Top level file
tree.files.push(file)
} else {
const levels = fPath.dir.split(SEP).slice(1)
const levels = fPath.dir.split(SEPARATOR).slice(1)
let currentLevelTree = tree
for (const level of levels) {
const exists = currentLevelTree.directories.find(
Expand Down
4 changes: 2 additions & 2 deletions bids-validator/src/validators/filenameIdentify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* object in the schema for reference.
*/
// @ts-nocheck
import { SEP } from '../deps/path.ts'
import { SEPARATOR } from '../deps/path.ts'
import { GenericSchema, Schema } from '../types/schema.ts'
import { BIDSContext } from '../schema/context.ts'
import { lookupModality } from '../schema/modalities.ts'
Expand Down Expand Up @@ -71,7 +71,7 @@ export async function datatypeFromDirectory(schema, context) {
const subFormat = schema.objects.formats[subEntity.format]
const sesEntity = schema.objects.entities.session.name
const sesFormat = schema.objects.formats[sesEntity.format]
const parts = context.file.path.split(SEP)
const parts = context.file.path.split(SEPARATOR)
let datatypeIndex = 2
if (parts[0] !== '') {
// we assume paths have leading '/'
Expand Down
4 changes: 2 additions & 2 deletions bids-validator/src/validators/filenameValidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CheckFunction, RuleCheckFunction } from '../types/check.ts'
import { DatasetIssues } from '../issues/datasetIssues.ts'
import { BIDSContext } from '../schema/context.ts'
import { GenericSchema, Schema, Entity, Format } from '../types/schema.ts'
import { SEP } from '../deps/path.ts'
import { SEPARATOR } from '../deps/path.ts'
import { hasProp } from '../utils/objectPathHandler.ts'

const sidecarExtensions = ['.json', '.tsv', '.bvec', '.bval']
Expand All @@ -25,7 +25,7 @@ export async function filenameValidate(
}

export function isAtRoot(context: BIDSContext) {
if (context.file.path.split(SEP).length !== 2) {
if (context.file.path.split(SEPARATOR).length !== 2) {
return false
}
return true
Expand Down
2 changes: 1 addition & 1 deletion bids-validator/src/validators/isBidsy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* derivatives to have the lowest common denomenator of bids like file names.
*/
// @ts-nocheck
import { SEP } from '../deps/path.ts'
import { SEPARATOR } from '../deps/path.ts'
import { BIDSContext } from '../schema/context.ts'
import { CheckFunction } from '../../types/check.ts'
import { BIDSFile } from '../types/file.ts'
Expand Down

0 comments on commit 0c53ce5

Please sign in to comment.