--- a/wp/wp-includes/js/dist/blob.js Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/js/dist/blob.js Wed Sep 21 18:19:35 2022 +0200
@@ -82,31 +82,33 @@
/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 284);
+/******/ return __webpack_require__(__webpack_require__.s = "ca5x");
/******/ })
/************************************************************************/
/******/ ({
-/***/ 284:
+/***/ "ca5x":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBlobURL", function() { return createBlobURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobByURL", function() { return getBlobByURL; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBlobTypeByURL", function() { return getBlobTypeByURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revokeBlobURL", function() { return revokeBlobURL; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlobURL", function() { return isBlobURL; });
/**
* Browser dependencies
*/
-var _window$URL = window.URL,
- createObjectURL = _window$URL.createObjectURL,
- revokeObjectURL = _window$URL.revokeObjectURL;
+const {
+ createObjectURL,
+ revokeObjectURL
+} = window.URL;
/**
* @type {Record<string, File|undefined>}
*/
-var cache = {};
+const cache = {};
/**
* Create a blob URL from a file.
*
@@ -116,7 +118,7 @@
*/
function createBlobURL(file) {
- var url = createObjectURL(file);
+ const url = createObjectURL(file);
cache[url] = file;
return url;
}
@@ -134,6 +136,21 @@
return cache[url];
}
/**
+ * Retrieve a blob type based on URL. The file must have been created by
+ * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
+ * `undefined`.
+ *
+ * @param {string} url The blob URL.
+ *
+ * @return {string|undefined} The blob type.
+ */
+
+function getBlobTypeByURL(url) {
+ var _getBlobByURL;
+
+ return (_getBlobByURL = getBlobByURL(url)) === null || _getBlobByURL === void 0 ? void 0 : _getBlobByURL.type.split('/')[0]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
+}
+/**
* Remove the resource and file cache from memory.
*
* @param {string} url The blob URL.