Skip to content

Commit

Permalink
fix for node 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredly committed Feb 12, 2020
1 parent 7635844 commit df18588
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/__tests__/__snapshots__/Basic.test.tsx.snap
Expand Up @@ -21,7 +21,6 @@ exports[`Counting nodes it is good with memory 1`] = `
}
/>
<Image
height={50}
source={
Object {
"uri": "https://cdn.kastatic.org/images/badges/meteorite/ten-to-fourth-40x40.png",
Expand All @@ -33,7 +32,6 @@ exports[`Counting nodes it is good with memory 1`] = `
"width": 50,
}
}
width={50}
/>
<Image
source={
Expand Down
4 changes: 3 additions & 1 deletion src/canvas/index.ts
Expand Up @@ -131,7 +131,9 @@ const tintedImage = async (imagePath, tintColor) => {

const getImage = async (imagePath) => {
const img = new CanvasImage()
img.src = await fs.promises.readFile(imagePath)
img.src = await new Promise((res, rej) =>
fs.readFile(imagePath, (err, val) => (err ? rej(err) : res(val)))
)
return img
}

Expand Down

0 comments on commit df18588

Please sign in to comment.