Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dep): Handle deprecations in deno>=0.214.0 #1902

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bids-validator/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"std/": "https://deno.land/std@0.214.0/"
"std/": "https://deno.land/std@0.217.0/"
},
"tasks": {
"test": "deno test -A src/tests/"
Expand Down
6 changes: 3 additions & 3 deletions bids-validator/src/deps/logger.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export {
ConsoleHandler,
critical,
debug,
error,
getLogger,
info,
Logger,
LogLevelNames,
LogLevels,
setup,
warning,
warn,
} from "std/log/mod.ts"
export { ConsoleHandler } from "std/log/console_handler.ts"
export { LogLevelNames } from "std/log/levels.ts"
export type { LevelName } from "std/log/mod.ts"
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'
2 changes: 1 addition & 1 deletion bids-validator/src/deps/stream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
readAll,
readerFromStreamReader,
} from 'std/streams/mod.ts'
} from 'std/io/mod.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
2 changes: 1 addition & 1 deletion bids-validator/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const loggerProxyHandler = {
const callerLocation = parseStack(stack)
logger.debug(`Logger invoked at "${callerLocation}"`)
}
const logFunc = logger[prop] as typeof logger.warning
const logFunc = logger[prop] as typeof logger.warn
return logFunc.bind(logger)
},
}
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
Loading