@wordpress/blob
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3
@@ -7,6 +7,3 @@ /** | ||
revokeObjectURL = _window$URL.revokeObjectURL; | ||
var cache = {}; | ||
/** | ||
@@ -19,10 +16,8 @@ * Create a blob URL from a file. | ||
*/ | ||
export function createBlobURL(file) { | ||
var url = createObjectURL(file); | ||
cache[url] = file; | ||
return url; | ||
} | ||
/** | ||
@@ -37,6 +32,6 @@ * Retrieve a file based on a blob URL. The file must have been created by | ||
*/ | ||
export function getBlobByURL(url) { | ||
return cache[url]; | ||
} | ||
/** | ||
@@ -47,2 +42,3 @@ * Remove the resource and file cache from memory. | ||
*/ | ||
export function revokeBlobURL(url) { | ||
@@ -49,0 +45,0 @@ if (cache[url]) { |
@@ -9,2 +9,3 @@ "use strict"; | ||
exports.revokeBlobURL = revokeBlobURL; | ||
/** | ||
@@ -16,6 +17,3 @@ * Browser dependencies | ||
revokeObjectURL = _window$URL.revokeObjectURL; | ||
var cache = {}; | ||
/** | ||
@@ -28,10 +26,8 @@ * Create a blob URL from a file. | ||
*/ | ||
function createBlobURL(file) { | ||
var url = createObjectURL(file); | ||
cache[url] = file; | ||
return url; | ||
} | ||
/** | ||
@@ -46,6 +42,7 @@ * Retrieve a file based on a blob URL. The file must have been created by | ||
*/ | ||
function getBlobByURL(url) { | ||
return cache[url]; | ||
} | ||
/** | ||
@@ -56,2 +53,4 @@ * Remove the resource and file cache from memory. | ||
*/ | ||
function revokeBlobURL(url) { | ||
@@ -58,0 +57,0 @@ if (cache[url]) { |
{ | ||
"name": "@wordpress/blob", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-alpha.3", | ||
"description": "Blob utils for WordPress", | ||
@@ -23,3 +23,4 @@ "author": "The WordPress Contributors", | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "8827c049ec802471f51a5cb906d9096ffc1b4e48" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3911