From 996fa350358e9ff848778e20d25403673799261c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 25 Sep 2023 13:37:42 -0400 Subject: [PATCH] fix(bindgen): node output file mountdirs varName --- .../typescript/src/apply-presentation-state-to-image-node.ts | 4 ++-- .../dicom/typescript/src/read-dicom-encapsulated-pdf-node.ts | 2 +- .../dicom/typescript/src/structured-report-to-html-node.ts | 4 ++-- .../dicom/typescript/src/structured-report-to-text-node.ts | 2 +- src/bindgen/typescript/function-module.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/dicom/typescript/src/apply-presentation-state-to-image-node.ts b/packages/dicom/typescript/src/apply-presentation-state-to-image-node.ts index 1ec54ea88..2c4649c27 100644 --- a/packages/dicom/typescript/src/apply-presentation-state-to-image-node.ts +++ b/packages/dicom/typescript/src/apply-presentation-state-to-image-node.ts @@ -37,8 +37,8 @@ async function applyPresentationStateToImageNode( { type: InterfaceTypes.Image }, ] - mountDirs.add(path.dirname(value as string)) - mountDirs.add(path.dirname(value as string)) + mountDirs.add(path.dirname(imageIn as string)) + mountDirs.add(path.dirname(presentationStateFile as string)) const inputs: Array = [ ] diff --git a/packages/dicom/typescript/src/read-dicom-encapsulated-pdf-node.ts b/packages/dicom/typescript/src/read-dicom-encapsulated-pdf-node.ts index 34711c764..cbbf03508 100644 --- a/packages/dicom/typescript/src/read-dicom-encapsulated-pdf-node.ts +++ b/packages/dicom/typescript/src/read-dicom-encapsulated-pdf-node.ts @@ -33,7 +33,7 @@ async function readDicomEncapsulatedPdfNode( { type: InterfaceTypes.BinaryStream }, ] - mountDirs.add(path.dirname(value as string)) + mountDirs.add(path.dirname(dicomFile as string)) const inputs: Array = [ ] diff --git a/packages/dicom/typescript/src/structured-report-to-html-node.ts b/packages/dicom/typescript/src/structured-report-to-html-node.ts index b8598613c..44603d164 100644 --- a/packages/dicom/typescript/src/structured-report-to-html-node.ts +++ b/packages/dicom/typescript/src/structured-report-to-html-node.ts @@ -33,7 +33,7 @@ async function structuredReportToHtmlNode( { type: InterfaceTypes.TextStream }, ] - mountDirs.add(path.dirname(value as string)) + mountDirs.add(path.dirname(dicomFile as string)) const inputs: Array = [ ] @@ -127,7 +127,7 @@ async function structuredReportToHtmlNode( } if (typeof options.cssFile !== "undefined") { const cssFile = options.cssFile - mountDirs.add(path.dirname(value as string)) + mountDirs.add(path.dirname(cssFile as string)) args.push('--css-file') const name = cssFile as string diff --git a/packages/dicom/typescript/src/structured-report-to-text-node.ts b/packages/dicom/typescript/src/structured-report-to-text-node.ts index 2c93962c1..a6e9c2cc9 100644 --- a/packages/dicom/typescript/src/structured-report-to-text-node.ts +++ b/packages/dicom/typescript/src/structured-report-to-text-node.ts @@ -33,7 +33,7 @@ async function structuredReportToTextNode( { type: InterfaceTypes.TextStream }, ] - mountDirs.add(path.dirname(value as string)) + mountDirs.add(path.dirname(dicomFile as string)) const inputs: Array = [ ] diff --git a/src/bindgen/typescript/function-module.js b/src/bindgen/typescript/function-module.js index f497bd6d6..83dfb8974 100644 --- a/src/bindgen/typescript/function-module.js +++ b/src/bindgen/typescript/function-module.js @@ -12,7 +12,7 @@ function readFileIfNotInterfaceType(forNode, interfaceType, varName, indent, isA if (isArray) { return `${indent}value.forEach((p) => mountDirs.add(path.dirname(p) as string))\n` } else { - return `${indent}mountDirs.add(path.dirname(value as string))\n` + return `${indent}mountDirs.add(path.dirname(${varName} as string))\n` } } else { @@ -363,7 +363,7 @@ function functionModule (srcOutputDir, forNode, interfaceJson, modulePascalCase, if (interfaceType.includes('File')) { // for files if (forNode) { - functionContent += ' mountDirs.add(path.dirname(value as string))\n' + functionContent += ` mountDirs.add(path.dirname(value as string))\n` functionContent += ' args.push(value as string)\n' } else { functionContent += readFileIfNotInterfaceType(forNode, interfaceType, 'value', ' ', false)