mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #9987 from Snuffleupagus/rm-createBlob
[api-minor] Remove the obsolete `createBlob` helper function
This commit is contained in:
commit
4ea663aa8a
3 changed files with 6 additions and 15 deletions
|
@ -101,7 +101,6 @@ exports.createValidAbsoluteUrl = pdfjsSharedUtil.createValidAbsoluteUrl;
|
|||
exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
|
||||
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
|
||||
exports.shadow = pdfjsSharedUtil.shadow;
|
||||
exports.createBlob = pdfjsSharedUtil.createBlob;
|
||||
exports.Util = pdfjsSharedUtil.Util;
|
||||
exports.ReadableStream = pdfjsSharedUtil.ReadableStream;
|
||||
exports.URL = pdfjsSharedUtil.URL;
|
||||
|
|
|
@ -969,13 +969,6 @@ function createPromiseCapability() {
|
|||
return capability;
|
||||
}
|
||||
|
||||
var createBlob = function createBlob(data, contentType) {
|
||||
if (typeof Blob !== 'undefined') {
|
||||
return new Blob([data], { type: contentType, });
|
||||
}
|
||||
throw new Error('The "Blob" constructor is not supported.');
|
||||
};
|
||||
|
||||
var createObjectURL = (function createObjectURLClosure() {
|
||||
// Blob/createObjectURL is not available, falling back to data schema.
|
||||
var digits =
|
||||
|
@ -983,7 +976,7 @@ var createObjectURL = (function createObjectURLClosure() {
|
|||
|
||||
return function createObjectURL(data, contentType, forceDataSchema = false) {
|
||||
if (!forceDataSchema && URL.createObjectURL) {
|
||||
var blob = createBlob(data, contentType);
|
||||
const blob = new Blob([data], { type: contentType, });
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
|
||||
|
@ -1033,7 +1026,6 @@ export {
|
|||
arraysToBytes,
|
||||
assert,
|
||||
bytesToString,
|
||||
createBlob,
|
||||
createPromiseCapability,
|
||||
createObjectURL,
|
||||
deprecated,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue