Skip to content

Commit

Permalink
fix(readDICOMTags): Allow webWorker to be null
Browse files Browse the repository at this point in the history
  • Loading branch information
cjh1 committed Aug 11, 2022
1 parent 0e6827a commit 9e5b242
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/io/readDICOMTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { readAsArrayBuffer } from 'promise-file-reader'
import ReadDICOMTagsResult from './ReadDICOMTagsResult.js'
import readDICOMTagsArrayBuffer from './readDICOMTagsArrayBuffer.js'

async function readDICOMTags (webWorker: Worker, file: File, tags: string[] | null = null): Promise<ReadDICOMTagsResult> {
async function readDICOMTags (webWorker: Worker | null, file: File, tags: string[] | null = null): Promise<ReadDICOMTagsResult> {
const arrayBuffer = await readAsArrayBuffer(file)
return await readDICOMTagsArrayBuffer(webWorker, arrayBuffer, tags)
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/readDICOMTagsArrayBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import config from '../itkConfig.js'
import ReadDICOMTagsResult from './ReadDICOMTagsResult.js'
import InterfaceTypes from '../core/InterfaceTypes.js'

async function readDICOMTagsArrayBuffer (webWorker: Worker, arrayBuffer: ArrayBuffer, tags: string[] | null = null): Promise<ReadDICOMTagsResult> {
async function readDICOMTagsArrayBuffer (webWorker: Worker | null, arrayBuffer: ArrayBuffer, tags: string[] | null = null): Promise<ReadDICOMTagsResult> {
let worker = webWorker
const { webworkerPromise, worker: usedWorker } = await createWebWorkerPromise(
worker
Expand Down

0 comments on commit 9e5b242

Please sign in to comment.