Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Commit d93864d

Browse files
committed
new createBlob method on DownloadedResource
1 parent dfdbb34 commit d93864d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/resources/base/DownloadedResource.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ export default class DownloadedResource {
127127
throw new Error('Object urls are not supported by Node');
128128
}
129129

130-
const blob = new Blob([this.data], { type: this.type });
130+
return URL.createObjectURL(this.createBlob());
131+
}
131132

132-
return URL.createObjectURL(blob);
133+
/**
134+
* Create a blob from the resource
135+
* @returns {Blob}
136+
*/
137+
createBlob () {
138+
return new Blob([this.data], { type: this.type });
133139
}
134140

135141
/**

0 commit comments

Comments
 (0)