Skip to content

Commit

Permalink
refactor: use Object.entries
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jun 23, 2022
1 parent b8cc6b8 commit 257524c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lambda/handler-runner/docker-runner/DockerContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 257524c

Please sign in to comment.