From 257524c016bc9d04745f4231ddd74ccabe3eac0d Mon Sep 17 00:00:00 2001 From: Daniel Nalborczyk Date: Wed, 22 Jun 2022 21:03:22 -0400 Subject: [PATCH] refactor: use Object.entries --- src/lambda/handler-runner/docker-runner/DockerContainer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lambda/handler-runner/docker-runner/DockerContainer.js b/src/lambda/handler-runner/docker-runner/DockerContainer.js index a21d4fa32..aa90ea3f4 100644 --- a/src/lambda/handler-runner/docker-runner/DockerContainer.js +++ b/src/lambda/handler-runner/docker-runner/DockerContainer.js @@ -12,7 +12,7 @@ import pRetry from 'p-retry' import DockerImage from './DockerImage.js' const { stringify } = JSON -const { entries, hasOwn, keys } = Object +const { entries, hasOwn } = Object export default class DockerContainer { #containerId = null @@ -311,9 +311,10 @@ export default class DockerContainer { const data = await readFile(layerZipFile) const zip = await jszip.loadAsync(data) + await Promise.all( - keys(zip.files).map(async (filename) => { - const fileData = await zip.files[filename].async('nodebuffer') + entries(zip.files).map(async ([filename, jsZipObj]) => { + const fileData = await jsZipObj.async('nodebuffer') if (filename.endsWith(sep)) { return Promise.resolve() }