Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dcmjs

Package Overview
Dependencies
Maintainers
14
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dcmjs - npm Package Compare versions

Comparing version 0.32.0 to 0.33.0

2

package.json
{
"name": "dcmjs",
"version": "0.32.0",
"version": "0.33.0",
"description": "Javascript implementation of DICOM manipulation",

@@ -5,0 +5,0 @@ "main": "build/dcmjs.js",

@@ -58,5 +58,5 @@ import fs from "fs";

async function getZippedTestDataset(url, filename, unpackDirectory) {
var dir = ensureTestDataDir();
var targetPath = path.join(dir, filename);
var unpackPath = path.join(dir, unpackDirectory);
const dir = ensureTestDataDir();
const targetPath = path.join(dir, filename);
const unpackPath = path.join(dir, unpackDirectory);
if (!fs.existsSync(unpackPath)) {

@@ -69,8 +69,17 @@ await downloadToFile(url, targetPath);

/**
* Stores the required downloads to prevent async reading before download completed.
*/
const asyncDownloadMap = new Map();
async function getTestDataset(url, filename) {
var dir = ensureTestDataDir();
var targetPath = path.join(dir, filename);
if (!fs.existsSync(targetPath)) {
await downloadToFile(url, targetPath);
const dir = ensureTestDataDir();
const targetPath = path.join(dir, filename);
let filePromise = asyncDownloadMap.get(targetPath);
if (!filePromise && !fs.existsSync(targetPath)) {
filePromise = downloadToFile(url, targetPath);
asyncDownloadMap.set(targetPath,filePromise);
}
// This returns immediately if filePromise is undefined - eg if the file already downloaded.
await filePromise;
return targetPath;

@@ -77,0 +86,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc